pynapple.IntervalSet.drop_info#

IntervalSet.drop_info(key)[source]#

Drop metadata based on metadata column name. Operates in place.

Parameters:

key ((str, list)) – Metadata column name(s) to drop.

Return type:

None

Examples

>>> import pynapple as nap
>>> import numpy as np
>>> times = np.array([[0, 5], [10, 12], [20, 33]])
>>> metadata = {"l1": [1, 2, 3], "l2": ["x", "x", "y"], "l3": [4, 5, 6]}
>>> ep = nap.IntervalSet(tmp,metadata=metadata)
>>> ep
  index    start    end    l1  l2      l3
      0        0      5     1  x        4
      1       10     12     2  x        5
      2       20     33     3  y        6
shape: (3, 2), time unit: sec.

To drop a single metadata column:

>>> ep.drop_info("l1")
>>> ep
  index    start    end  l2      l3
      0        0      5  x        4
      1       10     12  x        5
      2       20     33  y        6
shape: (3, 2), time unit: sec.

To drop multiple metadata columns:

>>> ep.drop_info(["l2", "l3"])
>>> ep
  index    start    end
      0        0      5
      1       10     12
      2       20     33
shape: (3, 2), time unit: sec.