[Numpy-discussion] TypeError when writing .data with python 2.5.1

Charles R Harris charlesr.harris@gmail....
Fri Apr 27 08:52:16 CDT 2007


On 4/27/07, Glen W. Mabey <Glen.Mabey@swri.org> wrote:
>
> The following works fine with a python 2.4.3 installation, but with
> 2.5.1 I get:
>
>
> In [1]:import numpy
>
> In [2]:fid = file( '/tmp/tfile', 'w' )
>
> In [3]:fid.write( numpy.zeros( 55 ).data )
>
> ---------------------------------------------------------------------------
> <type 'exceptions.TypeError'>             Traceback (most recent call
> last)
>
> /home/gmabey/src/R9619_dev_acqlibweb/Projects/R9619_NChannelDetection/NED/<ipython
> console> in <module>()
>
> <type 'exceptions.TypeError'>: non-character (or 8-bit) array cannot be
> interpreted as character buffer
> > <ipython console>(1)<module>()


Does

In [1]: numpy.zeros(55).tofile('/tmp/tfile')

work?

Chuck
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://projects.scipy.org/pipermail/numpy-discussion/attachments/20070427/0e88d327/attachment.html 


More information about the Numpy-discussion mailing list