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.
Comment From: jtratner
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.
Comment From: Komnomnomnom
@mtrbean you get anywhere with this. I'm aiming to work on it over the next few weeks / months.
Comment From: mtrbean
@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 :)
Comment From: nizamov
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
Comment From: jreback
well, the issue is still marked as open, and the errors message is pretty clear.
Comment From: jreback
closing as Panels are deprecated