lt_toolbox.TrajFrame.get_values#

TrajFrame.get_values(var: str, date: str, alias: str | None = None, fmt: str = '%Y-%m-%d') Self[source]#

Get the values of a specified column variable at a given date along each trajectory.

Parameters:
  • var (str) – Name of the column variable in the TrajFrame.

  • date (str) – date on which to get values of specified column variable.

  • alias (str, default: None) – New name of the resulting column variable.

  • fmt (str, default: "%Y-%m-%d") – Datetime format of specified date. Default format is YYYY-MM-DD.

Returns:

TrajFrame is returned with appended column variable {var}_i recording the values of spcified column variable at the given date.

Return type:

TrajFrame

Examples

Get the value of temperature for each trajectory on date 2000-01-31. Note that we must convert time to polars Datetime format before using .get_values().

>>>  trajectories.use_datetime(start_time='2000-01-01').get_values(var='temp', date='2000-01-31')