Guest User

Untitled

a guest
Apr 21st, 2018
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.29 KB | None | 0 0
  1. import numpy as np
  2.  
  3. im = [
  4. [1,2,3],
  5. [4,5,6]
  6. ]
  7. im = np.array(im)
  8. im_row = np.cumsum(im, axis=1)
  9. # satirlar dogrultusunda kumulatif toplam
  10. print im_row
  11. # [[ 1 3 6]
  12. # [ 4 9 15]
  13.  
  14. # sutunlar dogrultusunda kumulatif toplam
  15. im_col = np.cumsum(im, axis=0)
  16. print im_col
  17. # [[1 2 3]
  18. # [5 7 9]]
Add Comment
Please, Sign In to add comment