Core utilities that add pandas-esque features to arrow arrays and table.
Arrow forbids subclassing, so the classes are for logical grouping. Their methods are called as functions.
Column¶
-
class
graphique.core.
Column
[source]¶ Bases:
pyarrow.lib.ChunkedArray
Chunked array interface as a namespace of functions.
-
call
(func: Callable, *args) → pyarrow.lib.ChunkedArray[source]¶ Call compute function on array with support for dictionaries.
-
equal
(value) → pyarrow.lib.ChunkedArray[source]¶ Return boolean mask array which matches scalar value.
-
is_in
(values, invert=False) → pyarrow.lib.ChunkedArray[source]¶ Return boolean mask array which matches any value.
-
mask
(func='and', **query) → pyarrow.lib.ChunkedArray[source]¶ Return boolean mask array which matches query predicates.
-
not_equal
(value) → pyarrow.lib.ChunkedArray[source]¶ Return boolean mask array which doesn’t match scalar value.
-
range
(lower=None, upper=None, include_lower=True, include_upper=False) → slice[source]¶ Return slice within range from a sorted array, by default a half-open interval.
-
Table¶
-
class
graphique.core.
Table
[source]¶ Bases:
pyarrow.lib.Table
Table interface as a namespace of functions.
-
apply
(name: str, alias: str = '', **partials) → pyarrow.lib.Table[source]¶ Return view of table with functions applied across columns.
-
group
(name: str, reverse=False, predicate=<class 'int'>, sort=False) → Iterator[pyarrow.lib.Table][source]¶ Generate tables grouped by column, with filtering and slicing on table length.
-
is_in
(name: str, *values) → pyarrow.lib.Table[source]¶ Return rows which matches one of the values.
Assumes the table is sorted by the column name, i.e., indexed.
-
mask
(name: str, **query) → Iterator[pyarrow.lib.Array][source]¶ Return mask array which matches query.
-
not_equal
(name: str, value) → pyarrow.lib.Table[source]¶ Return rows which don’t match the value.
Assumes the table is sorted by the column name, i.e., indexed.
-
num_chunks
() → Optional[int][source]¶ Return number of chunks if consistent across columns, else None.
-
range
(name: str, lower=None, upper=None, **includes) → pyarrow.lib.Table[source]¶ Return rows within range, by default a half-open interval.
Assumes the table is sorted by the column name, i.e., indexed.
-
sort
(*names, reverse=False, length: int = None) → pyarrow.lib.Table[source]¶ Return table sorted by columns.
-