MCPcopy Create free account
hub / github.com/PyTables/PyTables / __iter__

Method __iter__

tables/vlarray.py:592–617  ·  view source on GitHub ↗

Iterate over the rows of the array. This is equivalent to calling :meth:`VLArray.iterrows` with default arguments, i.e. it iterates over *all the rows* in the array. Examples -------- :: result = [row for row in vlarray] Which is equiva

(self)

Source from the content-addressed store, hash-verified

590 return self
591
592 def __iter__(self) -> VLArray:
593 """Iterate over the rows of the array.
594
595 This is equivalent to calling :meth:`VLArray.iterrows` with default
596 arguments, i.e. it iterates over *all the rows* in the array.
597
598 Examples
599 --------
600 ::
601
602 result = [row for row in vlarray]
603
604 Which is equivalent to::
605
606 result = [row for row in vlarray.iterrows()]
607
608 """
609 if not self._init:
610 # If the iterator is called directly, assign default variables
611 self._start = 0
612 self._stop = self.nrows
613 self._step = 1
614 # and initialize the loop
615 self._init_loop()
616
617 return self
618
619 def _init_loop(self) -> None:
620 """Initialize the __iter__ iterator."""

Callers

nothing calls this directly

Calls 1

_init_loopMethod · 0.95

Tested by

no test coverage detected