We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
numpy.strings.str_len should put np.nan when in that position when encountering an string array with a missing value, but instead errors with
np.nan
Traceback (most recent call last): File "<stdin>", line 1, in <module> ValueError: The length of a null string is undefined
import numpy as np a = np.array(["a", "b", None], dtype=np.dtypes.StringDType(na_object=None)) np.strings.str_len(a)
'2.1.0.dev0+git20240424.f8392ce'
No response
The text was updated successfully, but these errors were encountered:
This is by design. What would be a sensible value for the length of a null string? Note that numpy doesn't have support for missing integer values.
Also, separately, none of the string ufuncs support None as a NaN-like NA object that passes through operations.
None
Sorry, something went wrong.
No branches or pull requests
Describe the issue:
numpy.strings.str_len should put
np.nan
when in that position when encountering an string array with a missing value, but instead errors withReproduce the code example:
Error message:
Python and NumPy Versions:
'2.1.0.dev0+git20240424.f8392ce'
Runtime Environment:
No response
Context for the issue:
No response
The text was updated successfully, but these errors were encountered: