[SciPy-user] unexpected array behaviour in newcore

Chris Fonnesbeck fonnesbeck at gmail.com
Thu Nov 3 09:58:00 CST 2005


I am trying to cast data into arrays within functions to allow for
consistent treatment of vector and scalar variables without having to
use switch statements. However, casting a scalar to an array under
newcore yields some unexpected behaviour:

>>> a = array(5)
>>> [i for i in a]
[]

Why would an empty list be returned here?

Thanks,
--
Chris Fonnesbeck
Atlanta, GA



More information about the SciPy-user mailing list