-
-
Notifications
You must be signed in to change notification settings - Fork 10.9k
genfromtxt won't unpack if dtype=None #4341
New issue
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
Comments
Looks like a bug, marking it so until informed otherwise. |
I investigated this a little bit. The result of @Gabriel-p's code is a shape (12,) flex array. The code calls The biggest issue that Since numCols << numRows in the text file, using a list or tuple shouldn't be a big deal. If implemented that way, it would unpack for However, |
Just got bitten by this, too. I made a test case, see
|
I also experience this.
Why doesn't |
Any update on this issue? It seems like it hasn't changed since 2014. |
The suggestion @moi90 made a couple years ago is correct. I think it will be easy to fix, so I've tagged the issue as a "good first issue". |
Previously, `genfromtxt` failed to transpose its output when `unpack=True` and `dtype` was structured (or `dtype=None` and the inferred `dtype` was structured). This patch resolves the issue by returning a list of arrays, as in `loadtxt`. Includes tests and updates the docstring to match `loadtxt`. Fixes numpy#4341
Not sure if this is a bug or a feature but if I use:
where
file.dat
is a standard data file with several columns (ie: http://pastebin.com/ihEW2dxS) the result is not transposed as one would expect having setunpack=True
.For example, the line
f_data = np.loadtxt('file.dat', unpack=True)
works as expected.The text was updated successfully, but these errors were encountered: