aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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}')