python-numpy python-matplotlib: problem with fromfile

Laurent Pezard lpezard at free.fr
Mon Dec 4 20:31:23 GMT 2006


Hi, I'm working with Ubuntu 6.10 and the following packages:

Package: python-numpy
Architecture: powerpc
Version: 1:1.0rc1-0ubuntu1

Package: python-matplotlib
Architecture: powerpc
Source: matplotlib
Version: 0.87.5-2ubuntu1

and I've noticed that the fromfile function of numpy doesn't work as 
expected when both numpy and pylab are imported.

Here is an example:

[nico] $ python
Python 2.4.4c1 (#2, Oct 11 2006, 19:53:58)
[GCC 4.1.2 20060928 (prerelease) (Ubuntu 4.1.1-13ubuntu5)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
 >>> import numpy as np
 >>> file = '/home/zarpe/Data/CdF/nico/final/bd13_ctrl.txt'
 >>> np.fromfile(file,sep='\n')
array([  4.17750000e-02,   6.88200000e-02,   1.25965000e-01, ...,
          5.98563250e+01,   5.99093200e+01,   5.99707450e+01])
# this is correct
 >>> import pylab as pl
 >>> np.fromfile(file, sep='\n')
array([ 0.])
# this is no longer correct

I hope this is of interest.

All the best,

LP



More information about the Ubuntu-motu mailing list