]> AND Private Git Repository - predictops.git/blobdiff - 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
index 1454e9d862a54d3d03ddf5acbbe7a597439ed6e9..aa6911bb38c632b06eff3c4cca81748ae8067d3a 100644 (file)
@@ -3,21 +3,22 @@ from datetime import datetime
 
 class ToArea:
 
-    def __init__(self, area = None,
-                 start = datetime.strptime('19960101000000', '%Y%m%d%H%M%S'),
-                 end = datetime.now(),
-                 csv_file = None):
+    def __init__(self, area = None, stream_file = None):
 
         self._area = area
-        self._csv_file = csv_file
+        self._stream_file = stream_file
         self._get_located_interventions()
 
 
     def _get_located_interventions(self):
-        with open(self._csv_file) as f:
+        with open(self._stream_file) as f:
             reader = DictReader(f, delimiter=',')
             for row in reader:
-                print(row)
+                start = datetime.strptime(row['start'], '%d/%m/%Y %H:%M:%S')
+                start.minute = 0
+                end   = datetime.strptime(row['end'], '%d/%m/%Y %H:%M:%S')
+                end.minute = 0
+