type float problem

rolandschulz rolandschulzhd at googlemail.com
Thu Mar 26 18:44:17 CET 2009


Hi,

why does

from numpy import *
a=array([.2])
print map(type,map(float,a))
print "%f"%map(float,a)

give :TypeError: float argument required

This is confusing because line 3 returns [<type 'float'>].

This is on python 2.5.2 and numpy 1.2.1.

Roland



More information about the Python-list mailing list