[Numpy-tickets] [NumPy] #404: numpy.fromfile on file-like object

NumPy numpy-tickets at scipy.net
Wed Dec 20 17:30:19 CST 2006


#404: numpy.fromfile on file-like object
------------------------+---------------------------------------------------
 Reporter:  eisele      |       Owner:  somebody
     Type:  defect      |      Status:  new     
 Priority:  normal      |   Milestone:          
Component:  numpy.core  |     Version:          
 Severity:  normal      |    Keywords:          
------------------------+---------------------------------------------------
 I would have expected that the following steps would allow to read an
 array from
 a compressed file:

 {{{
 from os import popen
 import numpy
 f = popen('zcat movieID.gz')
 a = numpy.fromfile(f,'int32',-1)
 }}}

 However, I get an array of length 0 and the
 message

 {{{
 zcat: stdout: Broken pipe
 }}}

 Is it reasonable to assume that this could be done?

 Thanks and best regards,
 Andreas

-- 
Ticket URL: <http://projects.scipy.org/scipy/numpy/ticket/404>
NumPy <http://projects.scipy.org/scipy/numpy>
The fundamental package needed for scientific computing with Python.


More information about the Numpy-tickets mailing list