opendvp.metrics.coefficient_of_variation#
- opendvp.metrics.coefficient_of_variation(df, axis=0, nan_policy='propagate', ddof=1)#
Calculate the coefficient of variation.
(CV = std / mean) along a specified axis of a DataFrame.
- Return type:
Parameters:#
- dfpandas.DataFrame
Input DataFrame.
- axisint, default 0
0 for column-wise CV, 1 for row-wise CV.
- nan_policy{‘propagate’, ‘raise’, ‘omit’}, default ‘propagate’
‘propagate’: returns NaN if NaN is present
‘raise’: raises ValueError if NaN is present
‘omit’: ignores NaNs in the calculation
- ddofint, default 1
Delta Degrees of Freedom used in the std calculation. The divisor used in calculations is N - ddof, default is 1
Returns:#
- pandas.Series
CV values for each row or column.
Raises:#
- ValueError
If nan_policy=’raise’ and NaNs are present