- self._data_directory = Path.cwd() / 'data' / 'targets' / 'sdis25'
- self._dict_interv = {}
- for year in range(2006,2018):
- if year < 2012:
- file_place = self._data_directory / 'interventions' / (str(year)+'.csv')
- else:
- file_place = self._data_directory / 'victims' / ('Liste_des_victimes_'+str(year)+'.csv')
- with open(file_place, "r") as f:
- reader = DictReader(f, delimiter='£')
- for row in reader:
- self._dict_interv.update({
- row['N° intervention']: {
- 'X' : row['Coord X'],
- 'Y' : row['Coord Y']
- } for row in reader
- })
- for csv_file in listdir(self._data_directory / 'interventions'):
- with open(self._data_directory / 'interventions' / csv_file, "r") as f:
- reader = DictReader(f, delimiter='£')
- for row in reader:
- if row['N° intervention'] in self._dict_interv:
- self._dict_interv[row['N° intervention']].update(
- {
- 'start': row['Début'],
- 'end' : row['Fin']
- })
- else:
- print(row['N° intervention'])
+ with open(self._csv_file) as f:
+ reader = DictReader(f, delimiter=',')
+ for row in reader:
+ print(row)
+