]> AND Private Git Repository - predictops.git/blob - predictops/target/toarea.py
Logo AND Algorithmique Numérique Distribuée

Private GIT Repository
Standardization and one hot encoding
[predictops.git] / predictops / target / toarea.py
1 from csv import DictReader
2 from datetime import datetime
3
4 class ToArea:
5
6     def __init__(self, area = None, stream_file = None):
7
8         self._area = area
9         self._stream_file = stream_file
10         self._get_located_interventions()
11
12
13     def _get_located_interventions(self):
14         with open(self._stream_file) as f:
15             reader = DictReader(f, delimiter=',')
16             for row in reader:
17                 start = datetime.strptime(row['start'], '%d/%m/%Y %H:%M:%S')
18                 start.minute = 0
19                 end   = datetime.strptime(row['end'], '%d/%m/%Y %H:%M:%S')
20                 end.minute = 0
21
22
23
24
25
26