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)
| 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.""" |