I have a weather API JSON data. I got from a website then converted python dictionary
markit_dict = json.loads(response.content)
markit_dict
then I turned a Dataframe
but as you can see the weather column needs to separate 3 different columns
when I choose each column to turn data frame I can
wh = pd.DataFrame(openwet.iloc[1,6])
wh
description icon id main
0 broken clouds 04d 803 Clouds
Last time I tried to put in a for loop to make dataframe but I could not
EDIT:
openwet = pd.DataFrame(markit_dict)
openwet['weather'].values
output :
array([ [{u'main': u'Clouds', u'id': 803, u'icon': u'04d', u'description': u'broken clouds'}],
[{u'main': u'Clouds', u'id': 803, u'icon': u'04d', u'description': u'broken clouds'}],
[{u'main': u'Clouds', u'id': 804, u'icon': u'04d', u'description': u'overcast clouds'}],
[{u'main': u'Clouds', u'id': 804, u'icon': u'04d', u'description': u'overcast clouds'}],
I need to make a Dataframe the weather column. Also I put my json data might be someone can find different way.
url = "http://history.openweathermap.org//storage/debd7a72617dd61b0fc871a2c83fcabf.json"
response = requests.get(url)
response.content