Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
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
Here's an example where loadtxt doesn't return the correct data.
loadtxt
In [23]: from io import StringIO In [24]: import numpy as np In [25]: point = np.dtype([('x', float), ('y', float)]) In [26]: dt = np.dtype([('code', int), ('points', point, (2,))]) In [27]: dt Out[27]: dtype([('code', '<i8'), ('points', [('x', '<f8'), ('y', '<f8')], (2,))]) In [28]: np.loadtxt(StringIO('100 1 2 3 4\n200 5 6 7 8\n'), dtype=dt) Out[28]: array([(100, [(1., 1.), (2., 2.)]), (200, [(5., 5.), (6., 6.)])], dtype=[('code', '<i8'), ('points', [('x', '<f8'), ('y', '<f8')], (2,))])
The expected value is array([(100, [(1., 2.), (3., 4.)]), (200, [(5., 6.), (7., 8.)])], ...)
array([(100, [(1., 2.), (3., 4.)]), (200, [(5., 6.), (7., 8.)])], ...)
NumPy version:
In [29]: np.__version__ Out[29]: '1.20.0.dev0+7af1024'
The text was updated successfully, but these errors were encountered:
The test here is included as part of gh-20580, so this can be closed when it is merged, I think.
EDIT: (To be clear, I would also be happy to just reject it, but this is the current choice and it does seem very reasonable)
Sorry, something went wrong.
Successfully merging a pull request may close this issue.
Uh oh!
There was an error while loading. Please reload this page.
Here's an example where
loadtxt
doesn't return the correct data.The expected value is
array([(100, [(1., 2.), (3., 4.)]), (200, [(5., 6.), (7., 8.)])], ...)
NumPy version:
The text was updated successfully, but these errors were encountered: