Skip to content

Commit

Permalink
Fix bug from old pandas for int cols
Browse files Browse the repository at this point in the history
Evidently old pandas versions throw an error if a column doesn't exist. This checks to see if the column exists before the values are set.
  • Loading branch information
kclem committed Apr 15, 2022
1 parent b34fe29 commit f67376f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion CRISPResso2/CRISPRessoBatchCORE.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,8 @@ def main():
'exclude_bp_from_right',
'plot_window_size', 'max_rows_alleles_around_cut_to_plot']
for int_col in int_columns:
batch_params[int_col] = batch_params[int_col].astype(int)
if int_col in batch_params.columns:
batch_params[int_col] = batch_params[int_col].astype(int)

#rename column "a" to "amplicon_seq", etc
batch_params.rename(index=str, columns=CRISPRessoShared.get_crispresso_options_lookup(), inplace=True)
Expand Down

0 comments on commit f67376f

Please sign in to comment.