In [1]:
import pandas as pd
In [5]:
import datetime
In [2]:
data = pd.read_table('daily_weather.tsv')
In [8]:
for i, row in enumerate(data['date']):
data.set_value(i, 'date', datetime.datetime.strptime(row, '%Y-%m-%d').date())
In [10]:
for i, row in enumerate(data['date']):
data.set_value(i, 'month', row.month)
In [12]:
data.groupby('month')['temp'].mean()
Out[12]: