-
Notifications
You must be signed in to change notification settings - Fork 4k
ARROW-9429: [Python] ChunkedArray.to_numpy #7868
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
Conversation
jorisvandenbossche
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While it technically is still using pandas during the conversion it exposes the to_numpy() method.
I think it is actually not using pandas (although the ConvertChunkedArrayToPandas name is certainly confusing in that case, but I thought this also worked without pandas being present. It just converts the arrow data to an array or dict that is in the appropriate form to convert to pandas)
|
@kszucs Can you rebase this PR? Hopefully it will fix AppVeyor. |
python/pyarrow/table.pxi
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this work if there's zero chunk, or do you need to pass the type explicitly?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to pass the type explicitly, fixing it.
python/pyarrow/table.pxi
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Either "All array chunks" (plural) or "Each array chunk" (singular).
|
@pitrou rebased and addressed your comments |
pitrou
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1, will merge
While it technically is still using pandas during the conversion it exposes the to_numpy() method.
Also refactored the chunked array construction to support more flexible input, see the test case.