Convert numpy type to python

后端 未结 4 1393
走了就别回头了
走了就别回头了 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:42

    If you leave the data in any of the pandas objects, the library supplies a to_json function on Series, DataFrame, and all of the other higher dimension cousins.

    See Series.to_json()

提交回复
热议问题