Skip to content

ENH: Implement to_json() for Panel #5428

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

Closed
mtrbean opened this issue Nov 4, 2013 · 6 comments
Closed

ENH: Implement to_json() for Panel #5428

mtrbean opened this issue Nov 4, 2013 · 6 comments
Labels
Enhancement IO JSON read_json, to_json, json_normalize

Comments

@mtrbean
Copy link
Contributor

mtrbean commented Nov 4, 2013

related #4889

Currently the to_json() method only works for Series and DataFrame, and raises NotImplementedError when called on Panel. Would be great to implement it for Panel as well.

For me it is sufficient to loop through all items and convert each item (DataFrame) to json separately and then stitch them together.

Happy to contribute code if needed.

@jtratner
Copy link
Contributor

jtratner commented Nov 4, 2013

go for it!

to_excel does the same thing, so fine to just iterate over dataframes. I might put it into the json as an array of DataFrames.

The tricky part is converting from json to panel...might need to add a keyword argument to use a slower path for panel for now...the json code can be complicated.

@Komnomnomnom
Copy link
Contributor

@mtrbean you get anywhere with this. I'm aiming to work on it over the next few weeks / months.

@mtrbean
Copy link
Contributor Author

mtrbean commented Feb 18, 2014

@Komnomnomnom Sorry no - I did not manage to get enough understanding of the json lib to implement this and I didn't want to construct a json string manually for panel. If you are going to work on this issue please feel free :)

@jreback jreback modified the milestones: 0.15.0, 0.14.0 Mar 9, 2014
@jreback jreback modified the milestones: 0.16.0, Next Major Release Mar 3, 2015
@nizamov
Copy link

nizamov commented Jun 2, 2015

Is this issue still open? The functionality is described in docs. If it is still pending then at least it should be clearly documented as not implemented.

http://pandas.pydata.org/pandas-docs/dev/generated/pandas.Panel.to_json.html#pandas.Panel.to_json

I am checking with 0.16.1 and get

raise NotImplementedError("'obj' should be a Series or a DataFrame")
NotImplementedError: 'obj' should be a Series or a DataFrame

@jreback
Copy link
Contributor

jreback commented Jun 2, 2015

well, the issue is still marked as open, and the errors message is pretty clear.

@jreback
Copy link
Contributor

jreback commented Jul 10, 2017

closing as Panels are deprecated

@jreback jreback closed this as completed Jul 10, 2017
@jreback jreback modified the milestones: Next Major Release, won't fix Jul 11, 2017
@TomAugspurger TomAugspurger modified the milestones: won't fix, No action Jul 6, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement IO JSON read_json, to_json, json_normalize
Projects
None yet
Development

No branches or pull requests

7 participants