Skip to content

Instantly share code, notes, and snippets.

@bjelline
Last active August 31, 2022 06:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bjelline/16dcb4681eee959bf3bed29356b442fb to your computer and use it in GitHub Desktop.
Save bjelline/16dcb4681eee959bf3bed29356b442fb to your computer and use it in GitHub Desktop.
Pandas Wetter Beispiel
import pandas as pd
df = pd.read_csv('wetter-salzburg-2021.csv', index_col=0)
df
# ----------
import matplotlib.pyplot as plt
ax = df['tmax'].plot(color='tab:red', title="Temperatur Salzburg")
ax.set_ylabel('average temperature in °C')
plt.savefig('wetter-salzburg-2021.png')
plt.show()
time tavg tmin tmax prcp wspd pres tsun
2021-01-01 -0.1 -2.5 2.9 64.0 10.5 1013.6 4020.0
2021-02-01 2.8 -1.6 9.1 47.0 10.1 1021.0 9120.0
2021-03-01 4.1 0.1 9.9 54.0 1022.9 9660.0
2021-04-01 7.1 2.3 12.4 53.0 10.9 1018.0 11700.0
2021-05-01 11.9 7.6 16.8 150.0 12.1 1014.2 10080.0
2021-06-01 20.1 13.7 26.2 109.0 10.5 1015.9 18360.0
2021-07-01 19.3 14.4 24.4 231.0 9.8 1014.4 14160.0
2021-08-01 17.3 13.5 22.2 278.0 10.3 1016.2 10380.0
2021-09-01 15.4 10.6 21.9 71.0 8.8 1019.3 14280.0
2021-10-01 8.5 4.9 14.5 36.0 9.1 1021.4 10200.0
2021-11-01 3.2 0.8 6.8 81.0 7.8 1018.0 3960.0
2021-12-01 1.7 -0.9 4.9 78.6 9.8 1018.2
import pandas as pd
import matplotlib.pyplot as plt
df = pd.read_csv('wetter-salzburg-2021.csv', index_col=0)
print(df)
ax = df['tmax'].plot(color='tab:red', title="Temperatur Salzburg")
ax.set_ylabel('average temperature in °C')
plt.savefig('wetter-salzburg-2021.png')
plt.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment