I have a dictionary of daily temperature data for 3 stations TemmpDict
. The keys are the station names and the values are the temperature data series.
I want to loop through this dictionary and create a data frame that contains the tmax data and mean tmax value for each station. I tried to do this with the following loop:
d=[]
for j in TempDict:
df=TempDict[j]
df.tmax=df.tmax.apply(pd.to_numeric,errors='coerce')
d.append((df.tmax,df.tmax.mean()))
LargeFrame=pd.DataFrame(d,columns=('tmax','meanmax'),index=StationList)
This appears to work when I print LargeFrame
.
But when I loop through and try to plot the tmax data for each station I get "TypeError: no numeric data to plot"
for j in LargeFrame:
LargeFrame.tmax.plot()
How can I store this data in a data frame so that I can still plot it?