Skip to content

Commit

Permalink
Merge pull request #190 from pynapple-org/dev
Browse files Browse the repository at this point in the history
Fix issue 187
  • Loading branch information
gviejo authored Oct 19, 2023
2 parents f551213 + e01373b commit 18edda3
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions pynapple/io/interface_nwb.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# -*- coding: utf-8 -*-
# @Author: Guillaume Viejo
# @Date: 2023-08-01 11:54:45
# @Last Modified by: Guillaume Viejo
# @Last Modified time: 2023-09-26 15:41:04
# @Last Modified by: gviejo
# @Last Modified time: 2023-10-19 12:16:55

"""
Pynapple class to interface with NWB files.
Expand Down Expand Up @@ -212,7 +212,11 @@ def _make_tsd_frame(obj):
elif isinstance(obj, pynwb.ecephys.ElectricalSeries):
# (channel mapping)
try:
columns = obj.electrodes["id"][:]
df = obj.electrodes.to_dataframe()
if hasattr(df, "label"):
columns = df["label"].values
else:
columns = df.index.values
except Exception:
columns = np.arange(obj.data.shape[1])

Expand Down

0 comments on commit 18edda3

Please sign in to comment.