import ibis
= ibis.examples.penguins.fetch() t
- 1
- Ensure you install Ibis first.
- 2
- Load a dataset from the built-in examples.
If you don’t have your own data, you can load example data from the ibis.examples
module:
Ibis configuration happens through the ibis.options
attribute. Attributes can be get and set like class attributes.
Ibis out of the box is in deferred mode. Expressions display their internal details when printed to the console.
r0 := DatabaseTable: penguins species string island string bill_length_mm float64 bill_depth_mm float64 flipper_length_mm int64 body_mass_g int64 sex string year int64 Limit[r0, n=3]
For a better interactive experience, set the interactive
option:
This will cause expressions to be executed immediately when printed to the console.
┏━━━━━━━━━┳━━━━━━━━━━━┳━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━┳━━━━━━━━┳━━━━━━━┓ ┃ species ┃ island ┃ bill_length_mm ┃ bill_depth_mm ┃ flipper_length_mm ┃ body_mass_g ┃ sex ┃ year ┃ ┡━━━━━━━━━╇━━━━━━━━━━━╇━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━╇━━━━━━━━╇━━━━━━━┩ │ string │ string │ float64 │ float64 │ int64 │ int64 │ string │ int64 │ ├─────────┼───────────┼────────────────┼───────────────┼───────────────────┼─────────────┼────────┼───────┤ │ Adelie │ Torgersen │ 39.1 │ 18.7 │ 181 │ 3750 │ male │ 2007 │ │ Adelie │ Torgersen │ 39.5 │ 17.4 │ 186 │ 3800 │ female │ 2007 │ │ Adelie │ Torgersen │ 40.3 │ 18.0 │ 195 │ 3250 │ female │ 2007 │ └─────────┴───────────┴────────────────┴───────────────┴───────────────────┴─────────────┴────────┴───────┘
If an Ibis table expression has no row limit set using the limit
API, a default one is applied to prevent too much data from being retrieved from the query engine. The default is currently 10000 rows, but this can be configured with the sql.default_limit
option:
Set this to None
to retrieve all rows in all queries
Setting the default limit to None
will result in all rows from a query coming back to the client from the backend.
To see all internal Ibis activity (like queries being executed) set ibis.options.verbose
:
By default this information is sent to sys.stdout
, but you can set some other logging function:
ibis.options.default_backend
controls which backend is used by table expressions returned by top-level functions such as ibis.memtable
, ibis.read_csv
or ibis.read_parquet
.
By default, it points to an instance of DuckDB backend. Assuming the backend dependencies have been installed, it can be updated by passing the name of the backend to ibis.set_backend
as follows: