In house nanmean. ddof argument will be used in _nanvar method
(ddof, value, axis=None, dtype=None, **kwargs)
| 106 | |
| 107 | |
| 108 | def _nanmean_ddof_object(ddof, value, axis=None, dtype=None, **kwargs): |
| 109 | """In house nanmean. ddof argument will be used in _nanvar method""" |
| 110 | valid_count = count(value, axis=axis) |
| 111 | value = fillna(value, 0) |
| 112 | # As dtype inference is impossible for object dtype, we assume float |
| 113 | # https://github.com/dask/dask/issues/3162 |
| 114 | if dtype is None and value.dtype.kind == "O": |
| 115 | dtype = float |
| 116 | |
| 117 | data = np.sum(value, axis=axis, dtype=dtype, **kwargs) |
| 118 | data = data / (valid_count - ddof) |
| 119 | return where_method(data, valid_count != 0) |
| 120 | |
| 121 | |
| 122 | def nanmean(a, axis=None, dtype=None, out=None): |
no test coverage detected
searching dependent graphs…