Skip to content

Commit bb40a50

Browse files
IndexSeekcpcloud
authored andcommitted
docs(examples): add example and see also ref for Table.execute
1 parent efbe5b1 commit bb40a50

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

ibis/expr/types/core.py

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -414,6 +414,41 @@ def execute(
414414
Mapping of scalar parameter expressions to value
415415
kwargs
416416
Keyword arguments
417+
418+
Examples
419+
--------
420+
>>> import ibis
421+
>>> t = ibis.examples.penguins.fetch()
422+
>>> t.execute()
423+
species island bill_length_mm ... body_mass_g sex year
424+
0 Adelie Torgersen 39.1 ... 3750.0 male 2007
425+
1 Adelie Torgersen 39.5 ... 3800.0 female 2007
426+
2 Adelie Torgersen 40.3 ... 3250.0 female 2007
427+
3 Adelie Torgersen NaN ... NaN None 2007
428+
4 Adelie Torgersen 36.7 ... 3450.0 female 2007
429+
.. ... ... ... ... ... ... ...
430+
339 Chinstrap Dream 55.8 ... 4000.0 male 2009
431+
340 Chinstrap Dream 43.5 ... 3400.0 female 2009
432+
341 Chinstrap Dream 49.6 ... 3775.0 male 2009
433+
342 Chinstrap Dream 50.8 ... 4100.0 male 2009
434+
343 Chinstrap Dream 50.2 ... 3775.0 female 2009
435+
[344 rows x 8 columns]
436+
437+
Scalar parameters can be supplied dynamically during execution.
438+
>>> species = ibis.param("string")
439+
>>> expr = t.filter(t.species == species).order_by(t.bill_length_mm)
440+
>>> expr.execute(limit=3, params={species: "Gentoo"})
441+
species island bill_length_mm ... body_mass_g sex year
442+
0 Gentoo Biscoe 40.9 ... 4650 female 2007
443+
1 Gentoo Biscoe 41.7 ... 4700 female 2009
444+
2 Gentoo Biscoe 42.0 ... 4150 female 2007
445+
<BLANKLINE>
446+
[3 rows x 8 columns]
447+
448+
See Also
449+
--------
450+
[`Table.to_pandas()`](./expression-tables.qmd#ibis.expr.types.relations.Table.to_pandas)
451+
[`Value.to_pandas()`](./expression-generic.qmd#ibis.expr.types.generic.Value.to_pandas)
417452
"""
418453
return self._find_backend(use_default=True).execute(
419454
self, limit=limit, params=params, **kwargs

0 commit comments

Comments
 (0)