How can I convert the second column of this matrix into int type inplace?
import numpy as np
x = np.array([[1.23e+02, 2.3], [1.3e+01, 2.9],[1.2e+01, 83.3]])
Desired output:
array([[ 123. , 2],
[ 13. , 2],
[ 12. , 83]])
The best I can come out with is this, but not inlace
x[:,1].astype(int)
dtypeper array, either allintor allfloat. (or allobjectto allow bothintandfloat, but that's idiotic: you'll loose all of numpy numerical performance...)