-
-
Notifications
You must be signed in to change notification settings - Fork 12.1k
Closed
Description
Using python 3.4.2 on Arch Linux with numpy 1.9.1, the following code doesn't work:
#!/usr/bin/env python
import sys
import numpy as np
data = np.genfromtxt(sys.stdin, names=True)
When running with a simple input file, it gives the following error:
Traceback (most recent call last):
File "./test.py", line 6, in <module>
data = np.genfromtxt(sys.stdin, names=True)
File "/usr/lib/python3.4/site-packages/numpy/lib/npyio.py", line 1395, in genfromtxt
if comments in first_line:
TypeError: 'in <string>' requires string as left operand, not bytes
The input file can be constructed with:
f = io.StringIO(u"""\
x y z
2.4 2.3 0.1
3.5 5.6 0.2""")There is no problem with python2.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels