Convert numpy type to python

后端 未结 4 1378
走了就别回头了
走了就别回头了 2020-11-27 05:18

I have a list of dicts in the following form that I generate from pandas. I want to convert it to a json format.

list_val = [{1.0: 685}, {2.0: 8}]
output = j         


        
4条回答
  •  攒了一身酷
    2020-11-27 05:46

    You could also convert the array to a python list (use the tolist method) and then convert the list to json.

提交回复
热议问题