Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import numpy as np
- xyz = np.array([[1, 2, 100],[2, 5, 100]])
- resultcolumn1 = (xyz[:,0]+xyz[:,1])*xyz[:,2]
- >>array([300, 700])
- >>type 'numpy.ndarray'>
- print np.concatenate((xyz, resultcolumn1.T), axis=1)
- resultcolumn2=np.array([[300, 700]])
- >>>array([[300, 700]])
- >>><type 'numpy.ndarray'>
- np.concatenate((xyz, resultcolumn2.T), axis=1)
- >>>[[ 1 2 100 300]
- [ 2 5 100 700]]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement