tbepler / topaz

Pipeline for particle picking in cryo-electron microscopy images using convolutional neural networks trained from positive and unlabeled examples. Also featuring micrograph and tomogram denoising with DNNs.
GNU General Public License v3.0
170 stars 62 forks source link

Avoid pandas df.iterrows dtype conversion #167

Closed fullerjamesr closed 1 year ago

fullerjamesr commented 1 year ago

Super small fix: the pandas df.iterrows() method reverts ints to floats, but in this case the results are used as list indices and must remain ints. This was causing exceptions/errors for me when using k-fold cross validation. See the Note at https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.iterrows.html

Replaced with df.itertuples() which preserves dtypes (as per suggestion in that same Note).

DarnellGranberry commented 1 year ago

Looks great, thanks!