Station report

Georgy Mokshantsev


In [23]:
import pandas as pd
import numpy as np
# Matplotlib plotting libraries
import matplotlib.pyplot as plt
%matplotlib inline
df = pd.read_csv('598354.csv')
df.head()
#GHCND:USW00093230 GHCND:USC00040741 GHCND:USC00041253
df =df[(df.TMIN>-9999)]
selected=df[(df.STATION=='GHCND:USC00040741') | (df.STATION=='GHCND:USW00093230') | (df.STATION=='GHCND:USC00041253')]
selected.TMIN=selected.TMIN/10
selected.TMAX=selected.TMAX/10
grouped = selected[(selected.TMIN>-9999)].groupby(['STATION_NAME'])
res = grouped.agg({'TMIN' : [np.min], 'TMAX' : [np.max]})
res.plot(kind='bar')
plt.show()



In [24]:
selected['DateTime']=pd.to_datetime((selected.DATE).apply(str),format='%Y%m%d')
bla = selected[(selected.DATE>=20150601) & (selected.DATE<=20150630) & (selected.TMIN>0)].groupby(['STATION_NAME'])[['DateTime','PRCP','TMIN','TMAX']]
print bla;
bla.plot()
plt.show()


<pandas.core.groupby.DataFrameGroupBy object at 0x7ffa6f8f9510>
/projects/sage/sage-6.9/local/lib/python2.7/site-packages/ipykernel/__main__.py:1: SettingWithCopyWarning: 
A value is trying to be set on a copy of a slice from a DataFrame.
Try using .loc[row_indexer,col_indexer] = value instead

See the the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy
  if __name__ == '__main__':

It's more raining where max temprature is lower


In [ ]:


In [ ]: