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)
| 592 | return deepcopy(self) |
| 593 | |
| 594 | def delete(self, idx): |
| 595 | """Remove an annotation. Operates inplace. |
| 596 | |
| 597 | Parameters |
| 598 | ---------- |
| 599 | idx : int | array-like of int |
| 600 | Index of the annotation to remove. Can be array-like to |
| 601 | remove multiple indices. |
| 602 | """ |
| 603 | self.onset = np.delete(self.onset, idx) |
| 604 | self.duration = np.delete(self.duration, idx) |
| 605 | self.description = np.delete(self.description, idx) |
| 606 | self.ch_names = np.delete(self.ch_names, idx) |
| 607 | if isinstance(idx, int_like): |
| 608 | del self.extras[idx] |
| 609 | elif len(idx) > 0: |
| 610 | # convert slice-like idx to ints, and delete list items in reverse order |
| 611 | for i in np.sort(np.arange(len(self.extras))[idx])[::-1]: |
| 612 | del self.extras[i] |
| 613 | |
| 614 | @fill_doc |
| 615 | def to_data_frame(self, time_format="datetime"): |
no outgoing calls