In [1]:
import pandas as pd

Charlotte


In [2]:
charlotte_rainfall = pd.read_csv('./Raw_RG_Data/Charlotte_CRN_gage_2003.csv', header = None)
for i in range(2004,2014):
    cur_rainfall = pd.read_csv('./Raw_RG_Data/Charlotte_CRN_gage_%d.csv' % i, header = None)
    charlotte_rainfall = charlotte_rainfall.append(cur_rainfall, ignore_index=True)

In [3]:
charlotte_rainfall.head()


Out[3]:
0 1 2 3 4 5 6 7 8 9 ... 66 67 68 69 70 71 72 73 74 75
0 2003 1 1 0 0 0.0 0.0 0.0 0.0 0.0 ... 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 -99.0
1 2003 1 1 0 15 0.0 0.0 0.0 0.0 0.0 ... 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 -99.0
2 2003 1 1 0 30 0.0 0.0 0.0 0.0 0.0 ... 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 -99.0
3 2003 1 1 0 45 0.0 0.0 0.0 0.0 0.0 ... 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 -99.0
4 2003 1 1 1 0 0.0 0.0 0.0 0.0 0.0 ... 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 -99.0

5 rows × 76 columns


In [4]:
charlotte_rainfall.to_csv('charlotte_rg_2003-2014.csv', header=False, index=False, columns=[0, 1, 2, 3, 4, 5], float_format='%0.5f')

In [ ]: