`count_unique` data operation handles NaNs badly
This MR corrects the handling of NaN
s in data_ops.py::count_unique
Apparently np.nan == np.nan
is false
; hence, np.count_unique
counts every np.nan
value separately. This causes the conversion to coordinates in xr.DataArray to fail (multiple coordinates with same value). Removing the np.nan
s from the counts resolves this.
Is dropping all np.nan
s the expected behaviour? I would say yes, but we could also count the occurrences of np.nan
instead.
Can this MR be accepted?
-
Implementation ready -
Tests added or adjusted -
Documentation extended or updated
-
Code quality -
Changes follow coding guidelines -
Checked code coverage on new and adjusted code
-
-
Ready for merging -
Pipeline passes without warnings -
History cleaned-up or squash option set -
Changelog entry added -
Version number bumped to appropriate v0.13.1
pre-release -
Reviewed & approved by @blsqr or @herdeanu
-
Related issues
Edited by Utopia Developers