-
-
Notifications
You must be signed in to change notification settings - Fork 18.2k
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
Provide a way to convert Arrow tables to Arrow-backed dataframes #51760
Comments
Arrow isn’t fully supported yet, just something to consider when communicating this. the easiest way is to provide a types mapper to to_pandas on an arrow table, that’s what we are using Internally as well |
Agree, but this seems like an important and common use case, and doesn't seem difficult to implement, no?
I didn't think about it, sounds good. But do we have a pandas function for the mapper, or is it something every user wanting this functionality should write? If that's the case the code I wrote is probably simpler. |
No we don’t have a common function and I remembers this incorrectly, we are only using it for our own nullable dtypes. Internally we are doing more or less the same as you did. you can wrap in an ArrowExtensionArray instead of using the Series |
This seems like something we should ask pyarrow to change? Supporting this in |
Ok there is actually an easy way to do this:
Edit: I think this should be sufficient for now? We should definitely document this. I'll open a PR. |
@phofl i think you can get rid of the lambda and just pass |
Oh good point, yes you are correct. |
this seems like the ideal soln; should just document for now |
As far as I could see, there is no easy way given a PyArrow table, to get a DataFrame with pyarrow types.
I'd expect that those idioms work:
I think the easier way to make the transition is with something like this:
@pandas-dev/pandas-core Given that Arrow dtypes is one of the highlights of pandas 2.0, shouldn't we provide at least one easy way to convert before the release?
The text was updated successfully, but these errors were encountered: