aboutsummaryrefslogtreecommitdiff
path: root/docs/user_guide/timestamped_data/ordered_dictionary.md
blob: a3154eb96e3bea6d9a28cefde8a8321b2e6a65f4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
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}
...
```