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

Method get_where_list

tables/table.py:1701–1730  ·  view source on GitHub ↗

Get the row coordinates fulfilling the given condition. The coordinates are returned as a list of the current flavor. sort means that you want to retrieve the coordinates ordered. The default is to not sort them. The meaning of the other arguments is the same as in

(
        self,
        condition: str,
        condvars: dict[str, Column | np.ndarray] | None = None,
        sort: bool = False,
        start: str | None = None,
        stop: str | None = None,
        step: str | None = None,
    )

Source from the content-addressed store, hash-verified

1699 return nrows
1700
1701 def get_where_list(
1702 self,
1703 condition: str,
1704 condvars: dict[str, Column | np.ndarray] | None = None,
1705 sort: bool = False,
1706 start: str | None = None,
1707 stop: str | None = None,
1708 step: str | None = None,
1709 ) -> np.ndarray:
1710 """Get the row coordinates fulfilling the given condition.
1711
1712 The coordinates are returned as a list of the current flavor. sort
1713 means that you want to retrieve the coordinates ordered. The default is
1714 to not sort them.
1715
1716 The meaning of the other arguments is the same as in the
1717 :meth:`Table.where` method.
1718
1719 """
1720 self._g_check_open()
1721
1722 coords = [
1723 p.nrow for p in self._where(condition, condvars, start, stop, step)
1724 ]
1725 coords = np.array(coords, dtype=SizeType)
1726 # Reset the conditions
1727 self._where_condition = None
1728 if sort:
1729 coords = np.sort(coords)
1730 return internal_to_flavor(coords, self.flavor)
1731
1732 def itersequence(self, sequence: Sequence) -> Iterator[tableextension.Row]:
1733 """Iterate over a sequence of row coordinates."""

Callers 15

test_methodFunction · 0.80
test00Method · 0.80
test_gh260Method · 0.80
test_gh262_01Method · 0.80
test_gh262_02Method · 0.80
test_gh262_03Method · 0.80
test_gh262_04Method · 0.80
test02_whereMethod · 0.80
test02b_whereAppendMethod · 0.80
test07_indexMethod · 0.80
test02_getWhereListMethod · 0.80
test09a_getStringsMethod · 0.80

Calls 3

_whereMethod · 0.95
internal_to_flavorFunction · 0.85
_g_check_openMethod · 0.80

Tested by 15

test_methodFunction · 0.64
test00Method · 0.64
test_gh260Method · 0.64
test_gh262_01Method · 0.64
test_gh262_02Method · 0.64
test_gh262_03Method · 0.64
test_gh262_04Method · 0.64
test02_whereMethod · 0.64
test02b_whereAppendMethod · 0.64
test07_indexMethod · 0.64
test02_getWhereListMethod · 0.64
test09a_getStringsMethod · 0.64