Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import numpy as np
- im = [
- [1,2,3],
- [4,5,6]
- ]
- im = np.array(im)
- im_row = np.cumsum(im, axis=1)
- # satirlar dogrultusunda kumulatif toplam
- print im_row
- # [[ 1 3 6]
- # [ 4 9 15]
- # sutunlar dogrultusunda kumulatif toplam
- im_col = np.cumsum(im, axis=0)
- print im_col
- # [[1 2 3]
- # [5 7 9]]
Add Comment
Please, Sign In to add comment