MCPcopy Index your code
hub / github.com/mne-tools/mne-python / delete

Method delete

mne/annotations.py:1260–1276  ·  view source on GitHub ↗

Remove an annotation. Operates inplace. Parameters ---------- idx : int | array-like of int Index of the annotation to remove. Can be array-like to remove multiple indices.

(self, idx)

Source from the content-addressed store, hash-verified

1258 )
1259
1260 def delete(self, idx):
1261 """Remove an annotation. Operates inplace.
1262
1263 Parameters
1264 ----------
1265 idx : int | array-like of int
1266 Index of the annotation to remove. Can be array-like to remove multiple
1267 indices.
1268 """
1269 super().delete(idx)
1270 if isinstance(idx, int_like):
1271 del self.hed_string._objs[idx]
1272 del self.hed_string[idx]
1273 else:
1274 for i in np.sort(np.arange(len(self.hed_string))[idx])[::-1]:
1275 del self.hed_string._objs[i]
1276 del self.hed_string[i]
1277
1278 def _sort(self):
1279 """Sort in place."""

Callers

nothing calls this directly

Calls 1

deleteMethod · 0.45

Tested by

no test coverage detected