Advertisement
Guest User

Untitled

a guest
Mar 30th, 2017
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. import numpy as np
  2. xyz = np.array([[1, 2, 100],[2, 5, 100]])
  3. resultcolumn1 = (xyz[:,0]+xyz[:,1])*xyz[:,2]
  4. >>array([300, 700])
  5. >>type 'numpy.ndarray'>
  6.  
  7. print np.concatenate((xyz, resultcolumn1.T), axis=1)
  8.  
  9. resultcolumn2=np.array([[300, 700]])
  10. >>>array([[300, 700]])
  11. >>><type 'numpy.ndarray'>
  12. np.concatenate((xyz, resultcolumn2.T), axis=1)
  13. >>>[[ 1 2 100 300]
  14. [ 2 5 100 700]]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement