-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
Infer dtype when using df.explode()
ENH:
#34923
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
Comments
I think this is reasonable. Can probably add a |
Can you elaborate @WillAyd , I looked in
|
My mistake - I meant to say |
ok this is not going to work as-is as its a breaking change. would suggest that we add |
if the implementation is just going to be |
I think the issue is that |
Is your feature request related to a problem?
Yes. Currently, the
df.explode
method always returns an object for the column being exploded. This leads to loss of information about thedtype
of the exploded column.E.g.
It would be great if pandas could return the underlying dtype if it was consistent across all rows. (Or return the best dtype (int -> float -> object).)
Describe the solution you'd like
Describe alternatives you've considered
Currently, I use the following workaround:
API breaking implications
Not sure.
The text was updated successfully, but these errors were encountered: