aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorThéo de la Hogue2022-04-20 19:03:15 +0200
committerThéo de la Hogue2022-04-20 19:03:15 +0200
commit2ebe773a5137048b013ee43e4ad4651e69ddc9bd (patch)
treeed14dd46c395b922f599783d2254fe0e37a78260 /src
parent10e72cde021b4c2a436879e178db1870103340a3 (diff)
downloadargaze-2ebe773a5137048b013ee43e4ad4651e69ddc9bd.zip
argaze-2ebe773a5137048b013ee43e4ad4651e69ddc9bd.tar.gz
argaze-2ebe773a5137048b013ee43e4ad4651e69ddc9bd.tar.bz2
argaze-2ebe773a5137048b013ee43e4ad4651e69ddc9bd.tar.xz
Starting to work on csv export.
Diffstat (limited to 'src')
-rw-r--r--src/argaze/DataStructures.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/argaze/DataStructures.py b/src/argaze/DataStructures.py
index 7409192..146978e 100644
--- a/src/argaze/DataStructures.py
+++ b/src/argaze/DataStructures.py
@@ -3,6 +3,7 @@
import collections
import json
import bisect
+import pandas
class DictObject():
"""Convert dictionnary into object"""
@@ -113,4 +114,16 @@ class TimeStampedBuffer(collections.OrderedDict):
except:
raise RuntimeError(f'Can\' write {filepath}')
+ def export_as_csv(self, filepath):
+ """Write buffer content into a csv file"""
+ try:
+
+ #series = pandas.Series(self)
+ #print(series)
+
+ df = pandas.DataFrame.from_dict(self, orient='index', columns=['data'])
+ df.to_csv(filepath, index=True)
+
+ except:
+ raise RuntimeError(f'Can\' write {filepath}')