diff options
author | Théo de la Hogue | 2023-06-07 14:34:14 +0200 |
---|---|---|
committer | Théo de la Hogue | 2023-06-07 14:34:14 +0200 |
commit | c4552e04e1271a9210a934233beae5be1943d034 (patch) | |
tree | a44041e544bc700976237bfea9058ec06f9a2904 /docs/user_guide/timestamped_data/ordered_dictionary.md | |
parent | bd9cd27c9d44c072164f564ffffeb22e37106b89 (diff) | |
download | argaze-c4552e04e1271a9210a934233beae5be1943d034.zip argaze-c4552e04e1271a9210a934233beae5be1943d034.tar.gz argaze-c4552e04e1271a9210a934233beae5be1943d034.tar.bz2 argaze-c4552e04e1271a9210a934233beae5be1943d034.tar.xz |
Writing User guide and use cases section.
Diffstat (limited to 'docs/user_guide/timestamped_data/ordered_dictionary.md')
-rw-r--r-- | docs/user_guide/timestamped_data/ordered_dictionary.md | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/docs/user_guide/timestamped_data/ordered_dictionary.md b/docs/user_guide/timestamped_data/ordered_dictionary.md new file mode 100644 index 0000000..8c93fc6 --- /dev/null +++ b/docs/user_guide/timestamped_data/ordered_dictionary.md @@ -0,0 +1,19 @@ +Ordered dictionary +================== + +[TimeStampedBuffer](/argaze/#argaze.DataStructures.TimeStampedBuffer) class inherits from [OrderedDict](https://docs.python.org/3/library/collections.html#collections.OrderedDict) as data are de facto ordered by time. + +Any data type can be stored using int or float keys as timestamp. + +```python +from argaze import DataStructures + +# Create a timestamped data buffer +ts_data = DataStructures.TimeStampedBuffer() + +# Store any data type using numeric keys +ts_data[0] = 123 +ts_data[0.1] = "message" +ts_data[0.23] = {"key": value} +... +``` |