You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
import numpy as np
from io import StringIO
s = StringIO(u'''# This comment should be ignored
field_name_0 field_name_1
0 1
2 3''')
data = np.genfromtxt(s, names=True)
The first line, minus the comment delimiter is being taken as the names for the dtype, causing the following error.
ValueError: Some errors were detected !
Line #2 (got 2 columns instead of 5)
Line #3 (got 2 columns instead of 5)
Line #4 (got 2 columns instead of 5)
This seems inconsistent with the fact that the following is fine, and that the documentation for the names and comments fields does not suggest this behavior.
import numpy as np
from io import StringIO
s = StringIO(u'''field_name_0 field_name_1
# This comment should be ignored
0 1
2 3''')
data = np.genfromtxt(s, names=True)
Was this behavior intended? If so I would like to update the documentation on the names field. If not, I'd change the names=True to ignore lines that are entirely comments.
The text was updated successfully, but these errors were encountered:
The following example runs into an error
The first line, minus the comment delimiter is being taken as the names for the dtype, causing the following error.
This seems inconsistent with the fact that the following is fine, and that the documentation for the names and comments fields does not suggest this behavior.
Was this behavior intended? If so I would like to update the documentation on the names field. If not, I'd change the names=True to ignore lines that are entirely comments.
The text was updated successfully, but these errors were encountered: