In [1]:
import pandas as pd

The first file contains one record per each rain day in 1983-1992 (obtained via Israeli Meteorological Service interface)

In [2]:
rain_df = pd.read_csv('rain_1983-92.csv',index_col='date')
rain_df.head(5)
Out[2]:
station rain_mm rain_code
date
01-01-1983 136739 17.0 0
02-01-1983 136739 14.8 0
03-01-1983 136739 8.5 0
04-01-1983 136739 16.3 0
05-01-1983 136739 4.7 0

The second file has daily temperatures (highs and lows; we'll use highs for interpreting 'coldest day of the year')

In [3]:
temp_df = pd.read_csv('temps_1983-92.csv')
temp_df.head(5)
Out[3]:
station date max_temp min_temp
0 2520 01-01-1983 12.3 6.0
1 2520 02-01-1983 12.4 7.5
2 2520 03-01-1983 11.7 7.2
3 2520 04-01-1983 12.0 7.0
4 2520 05-01-1983 14.2 7.5

Checking format works

In [4]:
rain_df.loc['01-01-1983'].rain_mm
Out[4]:
17.0
In [5]:
from datetime import datetime
temp_df['year'] = pd.Series([datetime.strptime(d,'%d-%M-%Y').year for d in temp_df.date])

min_temps = {y: temp_df[temp_df.year == y].max_temp.min() for y in range(1983,1993)}

min_temps
Out[5]:
{1983: 10.0,
 1984: 13.5,
 1985: 12.6,
 1986: 12.4,
 1987: 12.9,
 1988: 12.2,
 1989: 11.5,
 1990: 13.2,
 1991: 10.9,
 1992: 7.1}
In [6]:
min_temp_days = [d.date for d in temp_df.to_records() if d.max_temp == min_temps[d.year]]
min_temp_days
Out[6]:
['21-02-1983',
 '19-01-1984',
 '27-02-1985',
 '01-12-1986',
 '27-01-1987',
 '18-02-1988',
 '12-02-1989',
 '09-02-1990',
 '26-01-1991',
 '02-01-1992']
In [7]:
[rain_df.loc[d].rain_mm for d in min_temp_days if d in rain_df.index]
Out[7]:
[17.9, 0.0, 10.4, 1.2, 12.3, 10.4, 6.6, 3.6, 14.5]