-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
pandas.Series.tolist should convert Series contents from numpy datatypes to native Python datatypes #10904
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
Labels
Compat
pandas objects compatability with Numpy or Python functions
Dtype Conversions
Unexpected or buggy dtype conversions
Enhancement
Milestone
Comments
this is a bit tricker than it looks. pandas correctly handles boxing of dtypes (e.g. to Timestamp/categorical and such). So this is really just If you'd like to do a pull-request would prob accept. you should simply use |
4 tasks
jreback
added a commit
to jreback/pandas
that referenced
this issue
Sep 10, 2017
jreback
added a commit
to jreback/pandas
that referenced
this issue
Sep 10, 2017
jreback
added a commit
to jreback/pandas
that referenced
this issue
Sep 11, 2017
jreback
added a commit
to jreback/pandas
that referenced
this issue
Sep 11, 2017
jreback
added a commit
to jreback/pandas
that referenced
this issue
Sep 11, 2017
jreback
added a commit
to jreback/pandas
that referenced
this issue
Sep 11, 2017
jreback
added a commit
to jreback/pandas
that referenced
this issue
Sep 11, 2017
jreback
added a commit
to jreback/pandas
that referenced
this issue
Sep 12, 2017
jreback
added a commit
that referenced
this issue
Sep 12, 2017
alanbato
pushed a commit
to alanbato/pandas
that referenced
this issue
Nov 10, 2017
No-Stream
pushed a commit
to No-Stream/pandas
that referenced
this issue
Nov 28, 2017
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Compat
pandas objects compatability with Numpy or Python functions
Dtype Conversions
Unexpected or buggy dtype conversions
Enhancement
Noticed this in Pandas v0.16.1 when JSON serializing a large nested dictionary containing mixes of arrays, numpy arrays, and pandas series. Calling tolist() on numpy arrays allows the standard library JSON serializer to serialize them, but this is not the case for pandas.
numpy.array.tolist converts all of the array's contents to native Python datatypes. For compatibility with numpy, pandas.Series.tolist should also convert its contents to native Python datatypes. Currently, the list returned by pandas contains elements which have types like numpy.int64 or numpy.float64.
For example:
The text was updated successfully, but these errors were encountered: