```
# To make it easier to write for me, I am going to call you matrix "A": a, and "B": b
a_sum = np.sum(a, axis=0)
a_sum = a_sum[np.newaxis]
a_sum = np.repeat(a_sum, len(b), axis=0)
b = a_sum
a_cumsum = np.cumsum(a, axis=0)
b -= a_cumsum
```

by Lillie Brekke on Sep 23, 2022