I have a dataframe, test
, that contains winter temperatures since 1951 for a city. I want to plot the temperatures contained in the column called p95_annual
but when I try to do that using plt.plot(test.p95_annual.values)
I get the following:
Here's what test, wintermean, and test.wintermean.values looks like:
How can I plot this temperature data?
You have one single row in your DataFrame which has a string. You need to parse the individual values from this string before plotting it:
data = list(map(int, test.at[124,"p95_annual"][1:-1].split()))
>>> plt.plot(data)