import pandas as pd
import letsql as ls
= ls.connect()
con
= pd.DataFrame({"a": [1, 2, 3, 4, 5], "b": [2, 3, 4, 5, 6]})
df = con.register(df, "frame")
t
= t.head(3).execute()
res print(res)
a b
0 1 2
1 2 3
2 3 4
Please start by following the installation instructions, and then install pandas.
For this basic example let’s create a main.py
file with the following content:
import pandas as pd
import letsql as ls
con = ls.connect()
df = pd.DataFrame({"a": [1, 2, 3, 4, 5], "b": [2, 3, 4, 5, 6]})
t = con.register(df, "frame")
res = t.head(3).execute()
print(res)
a b
0 1 2
1 2 3
2 3 4
If you run python main.py
then your output should look like the above.