>>> import xorq as xo
>>> xo.options.interactive = False
>>> t = xo.memtable([{"a": 1}, {"a": 2}])
>>> t
InMemoryTable data: PandasDataFrameProxy: a 0 1 1 2
Construct an ibis table expression from in-memory data.
Name | Type | Description | Default |
---|---|---|---|
data | A table-like object (pandas.DataFrame , pyarrow.Table , or polars.DataFrame ), or any data accepted by the pandas.DataFrame constructor (e.g. a list of dicts). Note that ibis objects (e.g. MapValue ) may not be passed in as part of data and will result in an error. Do not depend on the underlying storage type (e.g., pyarrow.Table), it’s subject to change across non-major releases. |
required | |
columns | Iterable[str] | None | Optional of column names. If provided, must match the number of columns in data . |
None |
schema | SchemaLike | None | Optional Schema . The functions use data to infer a schema if not passed. |
None |
name | str | None | Optional name of the table. | None |
Name | Type | Description |
---|---|---|
Table | A table expression backed by in-memory data. |
>>> import xorq as xo
>>> xo.options.interactive = False
>>> t = xo.memtable([{"a": 1}, {"a": 2}])
>>> t
InMemoryTable data: PandasDataFrameProxy: a 0 1 1 2
┏━━━━━━━┳━━━━━━━━┓ ┃ a ┃ b ┃ ┡━━━━━━━╇━━━━━━━━┩ │ int64 │ string │ ├───────┼────────┤ │ 1 │ foo │ │ 2 │ baz │ └───────┴────────┘
Create a table literal without column names embedded in the data and pass columns
┏━━━━━━━┳━━━━━━━━┓ ┃ a ┃ b ┃ ┡━━━━━━━╇━━━━━━━━┩ │ int64 │ string │ ├───────┼────────┤ │ 1 │ foo │ │ 2 │ baz │ └───────┴────────┘
Create a table literal without column names embedded in the data. Ibis generates column names if none are provided.