Advertisement
Guest User

Untitled

a guest
Feb 28th, 2017
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.24 KB | None | 0 0
  1. In [11]: df
  2. Out[11]:
  3. Open High Low Close Volume Adj Close
  4. Date
  5. 2017-01-03 115.800003 116.330002 114.760002 116.150002 28781900 115.648597
  6. 2017-01-04 115.849998 116.510002 115.750000 116.019997 21118100 115.519154
  7. 2017-01-05 115.919998 116.860001 115.809998 116.610001 22193600 116.106611
  8. 2017-01-06 116.779999 118.160004 116.470001 117.910004 31751900 117.401002
  9. 2017-01-09 117.949997 119.430000 117.940002 118.989998 33387600 118.476334
  10. 2017-01-10 118.769997 119.379997 118.300003 119.110001 24462100 118.595819
  11.  
  12. In [12]: def func(idx, row):
  13. ...: print(idx, row['Open'], row['High'], row['Low'], row['Close'])
  14. ...: # здесь делаете все ваши вычисления, присвоения, etc. ...
  15. ...:
  16.  
  17. In [13]: for idx, r in df.iterrows():
  18. ...: func(idx, r)
  19. ...:
  20.  
  21. 2017-01-03 00:00:00 115.800003 116.330002 114.760002 116.150002
  22. 2017-01-04 00:00:00 115.849998 116.510002 115.75 116.019997
  23. 2017-01-05 00:00:00 115.919998 116.860001 115.809998 116.610001
  24. 2017-01-06 00:00:00 116.779999 118.160004 116.470001 117.910004
  25. 2017-01-09 00:00:00 117.949997 119.43 117.940002 118.989998
  26. 2017-01-10 00:00:00 118.769997 119.379997 118.300003 119.110001
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement