type float problem

rolandschulz rolandschulzhd at googlemail.com
Thu Mar 26 13:44:17 EDT 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