invert4geom.randomly_sample_data

invert4geom.randomly_sample_data#

randomly_sample_data(seed, data_df, data_col, uncert_col)[source]#

Given a dataframe with a data column and an uncertainty column, sample the data with a normal distribution within the uncertainty range. Note that this overwrites the data column with the newly sampled data.

Parameters:
  • seed (int) – random number generator seed

  • data_df (DataFrame) – dataframe with columns data_col and uncert_col

  • data_col (str) – name of data column to sample

  • uncert_col (str) – name of uncertainty column to sample within

Returns:

dataframe with data column updated with sampled values

Return type:

DataFrame