MCPcopy Index your code
hub / github.com/PyTables/PyTables / read_where

Method read_where

tables/table.py:1623–1654  ·  view source on GitHub ↗

Read table data fulfilling the given *condition*. This method is similar to :meth:`Table.read`, having their common arguments and return values the same meanings. However, only the rows fulfilling the *condition* are included in the result. The meaning of the other

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

Source from the content-addressed store, hash-verified

1621 return row._iter(start, stop, step, chunkmap=chunkmap)
1622
1623 def read_where(
1624 self,
1625 condition: str,
1626 condvars: dict[str, Column | np.ndarray] | None = None,
1627 field=None,
1628 start: str | None = None,
1629 stop: str | None = None,
1630 step: str | None = None,
1631 ) -> np.ndarray:
1632 """Read table data fulfilling the given *condition*.
1633
1634 This method is similar to :meth:`Table.read`, having their common
1635 arguments and return values the same meanings. However, only the rows
1636 fulfilling the *condition* are included in the result.
1637
1638 The meaning of the other arguments is the same as in the
1639 :meth:`Table.where` method.
1640
1641 """
1642 self._g_check_open()
1643 coords = [
1644 p.nrow for p in self._where(condition, condvars, start, stop, step)
1645 ]
1646 self._where_condition = None # reset the conditions
1647 if len(coords) > 1:
1648 cstart, cstop = coords[0], coords[-1] + 1
1649 if cstop - cstart == len(coords):
1650 # Chances for monotonically increasing row values. Refine.
1651 inc_seq = np.all(np.arange(cstart, cstop) == np.array(coords))
1652 if inc_seq:
1653 return self.read(cstart, cstop, field=field)
1654 return self.read_coordinates(coords, field)
1655
1656 def append_where(
1657 self,

Callers 10

test_methodFunction · 0.80
test03a_readWhereMethod · 0.80
test03b_readWhereMethod · 0.80
test_timecol_issueMethod · 0.80
test_issue_282Method · 0.80
test_issue_327Method · 0.80
test_issue_327_bMethod · 0.80
test_csindex_nansMethod · 0.80
test01Method · 0.80
collations.pyFile · 0.80

Calls 4

_whereMethod · 0.95
readMethod · 0.95
read_coordinatesMethod · 0.95
_g_check_openMethod · 0.80

Tested by 9

test_methodFunction · 0.64
test03a_readWhereMethod · 0.64
test03b_readWhereMethod · 0.64
test_timecol_issueMethod · 0.64
test_issue_282Method · 0.64
test_issue_327Method · 0.64
test_issue_327_bMethod · 0.64
test_csindex_nansMethod · 0.64
test01Method · 0.64