nwm_metrics.metric_functions.treat_values#
- nwm_metrics.metric_functions.treat_values(df, remove_neg=False, remove_na=False, replace_zero=False, replace_inf=False)[source]#
Remove NaN, inf and negative values, and replace zero values of time series.
- Return type:
DataFrame- Parameters:
df (pd.DataFrame) – Contains time series of observation and simulation.
remove_neg (bool, optional) – If True, when negative value occurs at the ith element of observation or simulation the ith element of both observation or simulation is removed.
remove_na (bool, optional) – If True, when NaN value occurs at the ith element of observation or simulation, the ith element of both observation or simulation is removed.
replace_zero (bool, optional) – If True, when the zero value occurs at the ith element of observation or simulation, all observation and simulation are added with 1/100 of mean of observation according to Pushpalatha et al (2012).
replace_inf (bool, optional) – If True, when the inf value occurs at the ith element of observation or simulation, the ith element of both observation or simulation is replaced with a large finite value.
- Returns:
New DataFrame with treated values
- Return type:
pd.DataFrame
References
- Pushpalatha, R., C. Perrin, N. L. Moine, V. Andreassian, 2012: A review of efficiency criteria suitable
for evaluating low-flow simulations. Journal of Hydrology, 420-421, 171-182.