BUG: Fix default fallback in genfromtxt#16242
Conversation
fba8b63 to
b802086
Compare
rossbar
left a comment
There was a problem hiding this comment.
LGTM - one comment about a comment perhaps falling out-of-sync with the code.
numpy/lib/tests/test__iotools.py
Outdated
There was a problem hiding this comment.
The preceding comment should be updated as well I think.
This affected (for example?) if the `dtype=object` was used without a converter, meaning that the default one is used. And this is currently the last one, which is `string_` (and thus bytes). Closes numpygh-16189
b802086 to
8bc4701
Compare
| (nx.integer, int, -1), | ||
| (nx.floating, float, nx.nan), | ||
| (nx.complexfloating, complex, nx.nan + 0j),]) | ||
| (nx.complexfloating, complex, nx.nan + 0j), |
There was a problem hiding this comment.
In what circumstance are these actually used? What fails if you just remove these three rather than moving two to the bottom.
(out of scope for this PR, but curious
There was a problem hiding this comment.
They should b be used for other dtypes such as i4 or float16 which are not specifically listed here. I guess the real reason why not to list all of them and rather have these is that it was the smaller change. (there are test failures if you delete this), but only for the integer case.
Co-authored-by: Eric Wieser <wieser.eric@gmail.com>
|
Thanks @seberg |
This affected (for example?) if the
dtype=objectwas usedwithout a converter, meaning that the default one is used.
And this is currently the last one, which is
string_(and thusbytes).
Closes gh-16189