ktk.TimeSeries.add_data_info

ktk.TimeSeries.add_data_info#

TimeSeries.add_data_info(data_key, info_key, value, *, overwrite=False, in_place=False)[source]#

Add metadata to TimeSeries’ data.

Parameters:
  • data_key (str) – The data key the info corresponds to.

  • info_key (str) – The key of the info dict.

  • value (Any) – The info.

  • overwrite (bool) – Optional. True to overwrite the data info if it is already present in the TimeSeries. Default is False.

  • in_place (bool) – Optional. True to modify the original TimeSeries. False to return a modified copy of the TimeSeries while leaving the original TimeSeries intact. Default is False.

Returns:

The TimeSeries with the added data info.

Return type:

TimeSeries

Example

>>> ts = ktk.TimeSeries()
>>> ts = ts.add_data_info("Forces", "Unit", "N")
>>> ts = ts.add_data_info("Marker1", "Color", [43, 2, 255])
>>> ts.data_info["Forces"]
{'Unit': 'N'}
>>> ts.data_info["Marker1"]
{'Color': [43, 2, 255]}