Open DGalt opened 7 years ago
Send me the file and I'll get a fix up and running.
This will happen with any abf file. Do you not have any on you?
Really? I'm currently opening 'abfs' on a daily basis and playing around with them, no issues.
What version of neo are you using?
The newest version from their master branch. Did they finally update whatever is available through pypy to make abf reading in Python 3 functional?
So looks like it was neo 0.5.1alpha that was causing the issue.
Wanna close this or keep it open and eventually fix the bug?
Closing this for now since it was solved by using the current pypi available version of neo - 0.4.1.
So I look in to this today, since for whatever reason I'm having trouble with 0.4.1 on my machine. Seems that to get to the actual underlying data you need to refer to analagsignals.data
(which doesn't actually give back anything useful, but you can convert it to a list or a numpy array).
This fixes the problem, if/when we decide to update to 0.5.1:
data = np.array(bl.segments[seg_num].analogsignals[i].data)
signals.append(data.T[0])
It actually looks like they updated PyPi to 0.5.1 earlier this month, so feel free to make the change and push the changes. Or I can, but I won't be able to make the changes until after my interview.
I think the issue is with neo, as that's what makes the most sense. Just updated everything (conda, anaconda, neo), and am getting this exception:
Started digging in to read_abf and what I'm thinking is that there is now a lot more information in something one of the things neo returns when it reads the abf file. Coming to this conclusion based on the data_dict that is passed to
pd.DataFrame(data_dict)
looks something like this:{'channel_1': AnalogSignal with 1 channels of length 2000; units V; datatype float32 name: "b'IN3'" annotations: {'channel_index': 3} sampling rate: 20000.0 Hz time: 0.0 s to 0.1 s, 'primary': AnalogSignal with 1 channels of length 2000; units V; datatype float32 name: "b'IN2'" annotations: {'channel_index': 2} sampling rate: 20000.0 Hz time: 0.0 s to 0.1 s, 'time': array([ 0.00000000e+00, 5.00000000e-05, 1.00000000e-04, ..., 9.98500000e-02, 9.99000000e-02, 9.99500000e-02]) * s}
which obviously is a bit of a mess and
pd.DataFrame
can't handle.