I came across some strange behavior when multiplying numpy floats and python lists: the list is returned unchanged:
> In [18]: np.float64(1.2) * [1, 2] > > Out[18]: [1, 2] On the other hand, multiplying an array scalar and a python list gives the expected answer > In [19]: np.array(1.2) * [1, 2] > > Out[19]: array([ 1.2, 2.4]) Finally, multiplying a python float and a python list gives an error: > In [20]: 1.2 * [1, 2] > --------------------------------------------------------------------------- > TypeError Traceback (most recent call last) > > /Users/Tony/<ipython console> in <module>() > > TypeError: can't multiply sequence by non-int of type 'float' These last two results (with the array scalar and the python float) both seem appropriate, but the numpy-float behavior is surprising. Is this a bug? -Tony _______________________________________________ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion