Calling np.unique() on data from a pandas DataFrame which contains a mix of string and NaN values generates an error:
malariagen_data/anoph/distance.py:530: in plot_njt
fig = anjl.plot(
../../../.cache/pypoetry/virtualenvs/malariagen-data-XR4NpaW--py3.12/lib/python3.12/site-packages/anjl/_plot.py:79: in plot
normalise_color_params(
../../../.cache/pypoetry/virtualenvs/malariagen-data-XR4NpaW--py3.12/lib/python3.12/site-packages/anjl/_plot.py:198: in normalise_color_params
unique_color_values = np.unique(leaf_color_values)
../../../.cache/pypoetry/virtualenvs/malariagen-data-XR4NpaW--py3.12/lib/python3.12/site-packages/numpy/lib/_arraysetops_impl.py:289: in unique
ret = _unique1d(ar, return_index, return_inverse, return_counts,
...
E TypeError: '<' not supported between instances of 'float' and 'str'
Possible solution is to drop NA values before passing to numpy.
Calling
np.unique()
on data from a pandas DataFrame which contains a mix of string and NaN values generates an error:Possible solution is to drop NA values before passing to numpy.