Description
Describe the issue:
Hi,
we are using numpy.fromstring to read data from a string. Usually, the string we pass to fromstring does not contain a trailing delimiter (","
). However, in a recent application it did: the data in the string was followed by a trailing delimiter and whitespace. We find that in that case fromstring returns an additional -1.0 in the resulting array.
import numpy as np
x = np.fromstring("0, ", sep=",")
print(x)
# array([ 0., -1.])
I would expect fromstring to simply return array([0.])
. Hopefully you can help me find what is going on here (and if it's an actual bug), many thanks.
Reproduce the code example:
import numpy as np
x = np.fromstring("0, ", sep=",")
print(x)
# array([ 0., -1.])
Error message:
There is no error message
Runtime information:
sys.version:
3.11.0 | packaged by conda-forge | (main, Oct 25 2022, 06:12:32) [MSC v.1929 64 bit (AMD64)]
numpy.version:
1.24.2
numpy.show_runtime()
WARNING: threadpoolctl
not found in system! Install it by pip install threadpoolctl
. Once installed, try np.show_runtime
again for more detailed build information
[{'simd_extensions': {'baseline': ['SSE', 'SSE2', 'SSE3'],
'found': ['SSSE3',
'SSE41',
'POPCNT',
'SSE42',
'AVX',
'F16C',
'FMA3',
'AVX2',
'AVX512F',
'AVX512CD',
'AVX512_SKX',
'AVX512_CLX'],
'not_found': ['AVX512_CNL', 'AVX512_ICL']}}]
None
Context for the issue:
No response