diff --git a/coastsnap/images_snapshot.py b/coastsnap/images_snapshot.py index 0a6f6cc..5d15306 100644 --- a/coastsnap/images_snapshot.py +++ b/coastsnap/images_snapshot.py @@ -107,7 +107,11 @@ for site in os.listdir(images_dir): # Loop through SITES # Add site stability data (# registered / # processed) for i, row in stats_csv.iterrows(): - stability = "{0:.0%}".format(stats_csv.at[i, '# registered'] / stats_csv.at[i, '# photoshop']) + + if stats_csv.at[i, '# photoshop'] != 0: + stability = "{0:.0%}".format(stats_csv.at[i, '# registered'] / stats_csv.at[i, '# photoshop']) + else: + stability = 'NaN' # or whatever value makes sense in your context stats_csv.at[i,'stability'] = stability stats_csv.set_index('site', inplace = True)