I have used a dataframe
with country and service data to count the recurrence of service grouped by country and generated the dictionary d. I have been trying to convert the dict
into json
since dict
type is not callable. But it is giving the following error
. What can be done to change the int64
into string?
TypeError: Object of type 'int64' is not JSON serializable
I have tried :
d = {'India': {'A': 1, 'C': 2}, 'Malaysia': {'B': 1, 'A': 1, 'D': 1}, 'Croatia': {'C': 1}}
y = json.dumps(d)
return y