Hi Mark,
this thread may help:
http://thread.gmane.org/gmane.comp.python.numeric.general/13399/focus=13421

Essentially, pylab uses a compatibility layer to ease the task of 
supporting the three array packages - currently this uses the Numeric 
version of the ones and zeros functions giving the behaviour you observe 
- this will be fixed when pylab drops support for the older packages, 
which should be soon.

Gary R.

Mark Bakker wrote:
> Hello list -
> 
> I am confused about the part of numpy that pylab imports.
> Apparently, pylab imports 'zeros', but not the 'zeros' from numpy, as it 
> returns integers by default, rather than floats.
> The same holds for 'ones' and 'empty'.
> Example:
>  >>> from pylab import *
>  >>> zeros(3)
> array([0, 0, 0])
>  >>> from numpy import *
>  >>> zeros(3)
> array([ 0.,  0.,  0.])
> 
> Can this be fixed? Any explanation how this happens? Pylab just imports 
> part of numpy, doesn't it?
> 
> Thanks,
> 
> Mark


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to