2021年4月9日星期五

Turn dictionary into dataframe

I'm new to Python. I have this kind of dictionary, from a geodesic output and i wonder if i can turn this into DataFrame or matrix? here's an example data, but what i'm working right now has more than 8000 data

{(0, 0): 0.0,   (0, 1): 1.3128088339744233,   (1, 0): 1.3128088339744233,   (1, 1): 0.0}  

desired output would be a DataFrame that looks like this

enter image description here

or is there any other way to create distance matrix using geodesic from geopy.calculation?

https://stackoverflow.com/questions/67029716/turn-dictionary-into-dataframe April 10, 2021 at 08:20AM

没有评论:

发表评论