[SciPy-User] scalars vs array of length 1
Thu Jul 8 11:44:49 CDT 2010
I want to write a function that can accept both a scalar and a vector, when called on a vector it should return a vector of scalar application results. However, scalars seem to be treated differently from length-1 lists.
from numpy import array,matrix,cos,sin,tan
valueMatrix = array([cos(x),sin(x),tan(x)])
valueMatrix = matrix(valueMatrix)
How do I get that shape to be the same in both cases?
More information about the SciPy-User