pastebin

Paste Search Dynamic
Recent pastes
diff hist
  1. diff_hist = [0,10,20,30,40]
  2. prev = 0
  3. accum_hist = []
  4. for i in diff_hist:
  5.     prev = prev + i
  6.     accum_hist.append(prev)
  7.  
  8. print (accum_hist)
  9.  
  10. accum_hist2 = [sum(diff_hist[:i]) for i in range(len(diff_hist))]
  11. print(accum_hist)
Parsed in 0.003 seconds