pynwb icon indicating copy to clipboard operation
pynwb copied to clipboard

get column through `DynamicTableRegion`

Open bendichter opened this issue 5 years ago • 1 comments

This works:

nwb.electrodes['group_name'][:]

But you can't use the same syntax with a DynamicTableRegion, for instance when you get the electrodes field from an ElectricalSeries. This doesn't work:

nwb.processing['ecephys']['LFP']['lfp'].electrodes['group_name'][:]

I'd like for you to be able to get a specific column of a DynamicTableRegion. This would pull the specific column from the target table and would return the specific region that is defined within the DynamicTableRegion.

bendichter avatar Feb 17 '20 23:02 bendichter

You can use this syntax:

nwb.processing['ecephys']['LFP']['lfp'].electrodes[:, 'group_name']

You can also use DynamicTableRegion.table to get the target table:

nwb.processing['ecephys']['LFP']['lfp'].electrodes.table['group_name'][:]

We can add the suggested enhancement in HDMF though. I opened an issue in HDMF.

rly avatar Jul 20 '21 16:07 rly