ktk.TimeSeries.remove_info

ktk.TimeSeries.remove_info#

TimeSeries.remove_info(outer_key, inner_key, *, in_place=False)[source]#

Remove info from a TimeSeries.

Parameters:
  • outer_key (str) – The key for the first level of nested dictionaries of ts.info. This is the generally what the information refers to (e.g., “Time”, or the related data key such as “Forces”.

  • inner_key (str) – The key for the second level of nested dictionaries of ts.info. This is generally the nature of the information (e.g., “Unit”).

  • in_place (bool) – Optional. True to modify and return 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 removed info.

Return type:

TimeSeries

Raises:

KeyError – If there is no in ts.info[outer_key][inner_key].

Example

>>> ts = ktk.TimeSeries()
>>> ts = ts.add_info("Forces", "Unit", "N")
>>> ts
TimeSeries with attributes:
      time: array([], dtype=float64)
      data: {}
    events: []
      info: {'Time': {'Unit': 's'}, 'Forces': {'Unit': 'N'}}
>>> ts = ts.remove_info("Forces", "Unit")
>>> ts
TimeSeries with attributes:
      time: array([], dtype=float64)
      data: {}
    events: []
      info: {'Time': {'Unit': 's'}}