bgc_data_processing.comparison.interpolation¶
Interpolation objects.
Interpolator(base, x_column_name, y_columns_name, kind='linear')
¶
  Interpolate slices with common index from a reference dataframe.
Parameters:
| Name | Type | Description | Default | 
|---|---|---|---|
base | 
          
                DataFrame
           | 
          
             DataFrame to use a base data for the interpolation.  | 
          required | 
x_column_name | 
          
                str
           | 
          
             name of the column to use as x for the interpolation.  | 
          required | 
kind | 
          
                str
           | 
          
             Type of interpolation, to pass to scipy.interpolate.interp1d. , by default "linear"  | 
          
                'linear'
           | 
        
Source code in src/bgc_data_processing/comparison/interpolation.py
                27 28 29 30 31 32 33 34 35 36 37 38  |  | 
kind = kind
  
  
      instance-attribute
  
¶
  
interpolate(row)
¶
  Interpolate a self.reference slice with same index as row.
This method is mostly meant to be applied using pd.DataFrame.apply method.
Parameters:
| Name | Type | Description | Default | 
|---|---|---|---|
row | 
          
                Series
           | 
          
             Row to use for interpolation.  | 
          required | 
Returns:
| Type | Description | 
|---|---|
                Series
           | 
          
             Interpolated series with same depth as row.  | 
        
Source code in src/bgc_data_processing/comparison/interpolation.py
            221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249  |  | 
interpolate_storer(observations_storer)
¶
  Interpolate over all rows a Store's dataframe.
Parameters:
| Name | Type | Description | Default | 
|---|---|---|---|
observations_storer | 
          
                Storer
           | 
          
             Storer to interpolate on each row.  | 
          required | 
Returns:
| Type | Description | 
|---|---|
                Storer
           | 
          
             Storer with interpolated rows to match observations_storer's x values.  | 
        
Source code in src/bgc_data_processing/comparison/interpolation.py
            251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279  |  |