Looping through an array
We could iterate over an array. The following code example prints each cash flow:
>>>import numpy as np >>>cash_flows=np.array([-100,50,40,30,25,-10,50,100]) >>>for cash in cash_flows: print x
We could iterate over an array. The following code example prints each cash flow:
>>>import numpy as np >>>cash_flows=np.array([-100,50,40,30,25,-10,50,100]) >>>for cash in cash_flows: print x