Pandas
This is just a wrapper over the DuckDB.from_pandas
class method.
Makes it more intuitive to do a from blendsql.db import Pandas
, for those
developers who might not know DuckDB supports pandas dataframes.
Examples:
from blendsql.db import Pandas
db = Pandas(
pd.DataFrame(
{
"name": ["John", "Parker"],
"age": [12, 26]
},
)
)
# Or, load multiple dataframes
db = Pandas(
{
"students": pd.DataFrame(
{
"name": ["John", "Parker"],
"age": [12, 26]
},
),
"classes": pd.DataFrame(
{
"class": ["Physics 101", "Chemistry"],
"size": [50, 32]
},
),
}
)
Source code in blendsql/db/_pandas.py
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
|