Learn practical skills, build real-world projects, and advance your career
import numpy as np
import pandas as pd
data=pd.read_csv('C:\\Users\\USER\\Desktop\\upgrad\\Pandas\\weatherdata.csv')
data.head()
data['year']=pd.DatetimeIndex(data['Date']).year
data['month']=pd.DatetimeIndex(data['Date']).month
data['dayofmonth']=pd.DatetimeIndex(data['Date']).day
data.head()
data_2016=data[data['year']==2016]
data_2016
Using pivot table find the average monthly rainfall of the year 2016 for all the locations

The information can be used to predict the sales in the year 2017