Iterate over the rows of the array. This method returns an iterator yielding an object of the current flavor for each selected row in the array. If a range is not supplied, *all the rows* in the array are iterated upon. You can also use the :meth:`VLArray.__iter__`
(
self,
start: int | None = None,
stop: int | None = None,
step: int | None = None,
)
| 555 | self.nrows += 1 |
| 556 | |
| 557 | def iterrows( |
| 558 | self, |
| 559 | start: int | None = None, |
| 560 | stop: int | None = None, |
| 561 | step: int | None = None, |
| 562 | ) -> VLArray: |
| 563 | """Iterate over the rows of the array. |
| 564 | |
| 565 | This method returns an iterator yielding an object of the current |
| 566 | flavor for each selected row in the array. |
| 567 | |
| 568 | If a range is not supplied, *all the rows* in the array are iterated |
| 569 | upon. You can also use the :meth:`VLArray.__iter__` special method for |
| 570 | that purpose. If you only want to iterate over a given *range of rows* |
| 571 | in the array, you may use the start, stop and step parameters. |
| 572 | |
| 573 | Examples |
| 574 | -------- |
| 575 | :: |
| 576 | |
| 577 | for row in vlarray.iterrows(step=4): |
| 578 | print('%s[%d]--> %s' % (vlarray.name, vlarray.nrow, row)) |
| 579 | |
| 580 | .. versionchanged:: 3.0 |
| 581 | If the *start* parameter is provided and *stop* is None then the |
| 582 | array is iterated from *start* to the last line. |
| 583 | In PyTables < 3.0 only one element was returned. |
| 584 | |
| 585 | """ |
| 586 | self._start, self._stop, self._step = self._process_range( |
| 587 | start, stop, step |
| 588 | ) |
| 589 | self._init_loop() |
| 590 | return self |
| 591 | |
| 592 | def __iter__(self) -> VLArray: |
| 593 | """Iterate over the rows of the array. |
nothing calls this directly
no test coverage detected