neuromodulation / py_neuromodulation

Real-time analysis of intracranial neurophysiology recordings.
https://neuromodulation.github.io/py_neuromodulation/
MIT License
41 stars 9 forks source link

Fix handling of dataframe input, issue #300 #301

Closed toni-neurosc closed 2 months ago

toni-neurosc commented 2 months ago

This should fix the problem in #300, by returning the transposed version of the data from _OfflineStream._handle_data when the input is given in the form of a DataFrame. I also fixed the Error message that caused the confusion in the first place.

Additionally, this raises the issue of having 2 different expected data input layouts:

Changing the expected dimensions of the np.array is most likely impossible since it would break compatibility. But also changing the dimensionality of dataframes is probably also not a good idea since rows for datapoints and columns for features is the standard way people organize data.

So I have settled for this solution for now.

timonmerk commented 2 months ago

That's great. Thanks for fixing so fast @toni-neurosc!