changeset 1131:3972d85e3b6c

work on loading data for sumo
author Nicolas Saunier <nicolas.saunier@polymtl.ca>
date Thu, 20 Feb 2020 23:56:56 -0500
parents 18e2c8cb9b09
children 09ef0dc994a0
files trafficintelligence/storage.py trafficintelligence/sumo.py
diffstat 2 files changed, 9 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/trafficintelligence/storage.py	Tue Feb 11 03:47:05 2020 +0000
+++ b/trafficintelligence/storage.py	Thu Feb 20 23:56:56 2020 -0500
@@ -945,6 +945,13 @@
 # txt files
 #########################
 
+def loadCSVs(filenames, **kwargs):
+    '''Loads all the data from the filenames (eg from glob) and returns a concatenated dataframe'''
+    data = read_csv(filenames[0], **kwargs)
+    for f in filenames[1:]:
+        data = data.append(read_csv(filenames[0], **kwargs))
+    return data
+
 def saveList(filename, l):
     f = utils.openCheck(filename, 'w')
     for x in l:
--- a/trafficintelligence/sumo.py	Tue Feb 11 03:47:05 2020 +0000
+++ b/trafficintelligence/sumo.py	Thu Feb 20 23:56:56 2020 -0500
@@ -2,8 +2,9 @@
 '''Libraries for the SUMO traffic simulation software
 http://sumo.dlr.de
 '''
+import pandas as pd
 
-#import csv
+    
 
 def loadTazEdges(inFilename):
     '''Converts list of OSM edges per OSM edge and groups per TAZ