nearest_neighbors_err_at_time_or_it#

post_processors.nearest_neighbors_err_at_time_or_it(time_stamps=None, it_stamps=None, err_name='errors', time_name='timings')#

Adds to dataframe df columns err_at_time_xx or err_at_it_xx containing an estimation of errors at given time points or iteration values xx. The estimation is performed for the err_at_time_xx column using the nearest neighbor error value.

For a more precise interpolation, check out the interpolate_time_and_error function.

Parameters:
  • df (pandas dataframe) – A dataframe containing an err_name column and a time_name column

  • time_stamps (list, optional) – a list of values at which the column err_name should be evaluated, by default None

  • it_stamps (list, optional) – a list of indices at which the column err_name should be evaluated, by default None

  • err_name (str, optional) – the name of the error column in df, by default errors

  • time_name (str, optional) – the name of the timings columns in df, by default timings

Returns:

df – the input dataframe with appended columns err_at_time_xx or err_at_it_xx.

Return type:

pandas dataframe