[Numpy-discussion] fromfile for dtype=Int8

Erin Sheldon erin.sheldon at gmail.com
Sun May 28 08:34:16 EDT 2006


Hi everyone -

The "fromfile" method isn't working for Int8 in
ascii mode:

# cat test.dat
3
4
5
>>> import numpy as np
>>> np.__version__
'0.9.9.2547'
>>> np.fromfile('test.dat', sep='\n', dtype=np.Int16)
array([3, 4, 5], dtype=int16)
>>> np.fromfile('test.dat', sep='\n', dtype=np.Int8)
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
ValueError: don't know how to read character files with that array type

Was this intended?
Erin




More information about the NumPy-Discussion mailing list