SHARE
TWEET

Untitled

a guest Sep 21st, 2019 86 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import numpy as np
  2. import pandas as pd
  3.  
  4. temp = pd.DataFrame({
  5.     "Luzern": ([1, 5, 9, 15, 20, 25, 25]),
  6.     "Basel": ([3, 4, 12, 16, 18, 23, 32]),
  7.     "Zuerich": ([8, 6, 10, 17, 23, 22, 24])},
  8.     index=["jan", "feb", "mar", "apr", "mai", "jun", "jul"]
  9. )
  10.  
  11. print(temp)
  12.  
  13. # Index resp. Spaltennamen des temp DataFrames ausgeben
  14. print(temp.columns)
  15.  
  16. # Durchscnittstemperatur aller Städte
  17. print(temp.mean())
  18.  
  19. # Alle Temperaturwerte für Basel anzeigen
  20. print(temp.loc[:, "Basel"])
  21.  
  22. # Temperatur im Februar in Luzern
  23. print(temp.loc["feb", "Luzern"])
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top