Advertisement
viedin

Untitled

Sep 28th, 2021
1,028
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.31 KB | None | 0 0
  1. import pandas as pd
  2.  
  3. rainPerMont = {}
  4.  
  5. def rain_month():
  6.     df = pd.read_csv("MOCK_DATA.csv", sep=',')
  7.     count = 1
  8.     while count < 13:
  9.         rainPerMont[count] = df.loc[pd.to_datetime(df['Date']).dt.month == count, 'Rain'].sum()
  10.         count+=1
  11.        
  12.     print(rainPerMont)
  13.  
  14.  
  15.  
  16. rain_month()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement