JSON to pandas DataFrame

后端 未结 11 1711
离开以前
离开以前 2020-11-22 05:46

What I am trying to do is extract elevation data from a google maps API along a path specified by latitude and longitude coordinates as follows:

from urllib2         


        
11条回答
  •  长情又很酷
    2020-11-22 06:25

    Once you have the flattened DataFrame obtained by the accepted answer, you can make the columns a MultiIndex ("fancy multiline header") like this:

    df.columns = pd.MultiIndex.from_tuples([tuple(c.split('.')) for c in df.columns])
    

提交回复
热议问题