NeuralAnalysis / PyalData

Repository for the Python implementation of the TrialData analysis library.
GNU General Public License v3.0
7 stars 9 forks source link

Index error in `restrict_to_interval` #102

Closed AtMostafa closed 3 years ago

AtMostafa commented 3 years ago

In some datasets, some index fields (like idx_movement_on) are floats and cause an indexing error in the restrict_to_interval. A quick fix is the following:

df_['idx_movement_on'] = np.int64(df_.idx_movement_on)

AtMostafa commented 3 years ago

Issue is related to some nan values in the idx_movement_on which turns the whole column to float, instead of int. The quick fix above shouldn't actually work, because np.int64(np.nan) should throw a ValueError which it doesn't, probably because of this pandas bug.