When converting data to json, "Object of type int64 is not JSON serializable" error occurs
Closed this issue · 1 comments
paulhoekman commented
I tried to convert my sankey data to json, using the .to_json function. However, the following error is returned:
Object of type int64 is not JSON serializable
When looking at the code, the code is converted using:
json.dump(data, f)
The data object contains a pandas dataframe, and this is in effect a numpy array, which seems to be where the problem originates. See here and here for instance.
paulhoekman commented
I made a pull request here where this issue is resolved. Closing it for that reason - not sure how I could directly link pull request and this reported issue and it seems a duplication otherwise. #