
25 Jul
2010
25 Jul
'10
3:56 a.m.
Hello,
After a little more research, I can see that as a work around is:
foo = np.append(foo, np.asanyarray([1., 2., 3.], dtype=foo.dtype))
It seems that within numpy.append(), the call to ravel() (numpy/ function.base.py [line 3490]) produces an array with a dtype that best fits. In this case it is float64 (when my original array was float32).
Best wishes