Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
pola-rs
GitHub Repository: pola-rs/polars
Path: blob/main/docs/source/src/python/user-guide/sql/show.py
7890 views
1
# --8<-- [start:setup]
2
import polars as pl
3
4
# --8<-- [end:setup]
5
6
7
# --8<-- [start:show]
8
# Create some DataFrames and register them with the SQLContext
9
df1 = pl.LazyFrame(
10
{
11
"name": ["Alice", "Bob", "Charlie", "David"],
12
"age": [25, 30, 35, 40],
13
}
14
)
15
df2 = pl.LazyFrame(
16
{
17
"name": ["Ellen", "Frank", "Gina", "Henry"],
18
"age": [45, 50, 55, 60],
19
}
20
)
21
ctx = pl.SQLContext(mytable1=df1, mytable2=df2)
22
23
tables = ctx.execute("SHOW TABLES", eager=True)
24
25
print(tables)
26
# --8<-- [end:show]
27
28