Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create dataframes from Python objects (pandas, polars, dictionary, list, pyarrow Table) #241

Closed
5 tasks
simicd opened this issue Feb 26, 2023 · 0 comments · Fixed by #242
Closed
5 tasks
Labels
enhancement New feature or request

Comments

@simicd
Copy link
Contributor

simicd commented Feb 26, 2023

Is your feature request related to a problem or challenge? Please describe what you are trying to do.
With PR #235 & #197 datafusion DataFrames can be directly converted to Python list, Python dictionary, pandas, polars or Arrow Table. I'd like to have the functionality to go the other way and create datafusion DataFrames from these object types, e.g. from a dictionary:

import datafusion

ctx = datafusion.SessionContext()
df = ctx.from_pydict({"a": [1, 2, 3], "b": [4, 5, 6]})
# Dataframe:
# +---+---+
# | a | b |
# +---+---+
# | 1 | 4 |
# | 2 | 5 |
# | 3 | 6 |
# +---+---+

Describe the solution you'd like
Context methods that can generate datafusion DataFrames using pyarrow's from_... methods (e.g. from_pandas, from_pydict, ...)

  • from_pydict
  • from_pylist
  • from_pandas
  • from_polars
  • from_arrow_table

Describe alternatives you've considered
n/a

Additional context
n/a

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
1 participant