Mercurial > hg > nsaunier > traffic-intelligence
comparison trafficintelligence/storage.py @ 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 | e53c6e87bb3f |
| children | c4d9c270f999 |
comparison
equal
deleted
inserted
replaced
| 1130:18e2c8cb9b09 | 1131:3972d85e3b6c |
|---|---|
| 942 connection.close() | 942 connection.close() |
| 943 | 943 |
| 944 ######################### | 944 ######################### |
| 945 # txt files | 945 # txt files |
| 946 ######################### | 946 ######################### |
| 947 | |
| 948 def loadCSVs(filenames, **kwargs): | |
| 949 '''Loads all the data from the filenames (eg from glob) and returns a concatenated dataframe''' | |
| 950 data = read_csv(filenames[0], **kwargs) | |
| 951 for f in filenames[1:]: | |
| 952 data = data.append(read_csv(filenames[0], **kwargs)) | |
| 953 return data | |
| 947 | 954 |
| 948 def saveList(filename, l): | 955 def saveList(filename, l): |
| 949 f = utils.openCheck(filename, 'w') | 956 f = utils.openCheck(filename, 'w') |
| 950 for x in l: | 957 for x in l: |
| 951 f.write('{}\n'.format(x)) | 958 f.write('{}\n'.format(x)) |
