Hello i have the function Walk1d which then i want to calculate the cumsum.
I use Walk1d=lambda n: sc.cumsum(steps(n)) .The result is an array but when i am trying Walk1d.cumsum() it doesn’t work because type(Walk1d) is a function.
If i try sc.array(Walk1d).cumsum() it gives me : at 0x3798488>
How can i handle this?
import matplotlib.pyplot as plt
import scipy as sc
steps=lambda m: 2*sc.random.random_integers(0,1,size=m)-1
Walk1d=lambda n: sc.cumsum(steps(n))
print(sc.array(Walk1d).cumsum())
Thanks!
Walk1dis a function taking an argument. You have to call the function and pass in an argument to get a result, for example