Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- In [11]: df
- Out[11]:
- Open High Low Close Volume Adj Close
- Date
- 2017-01-03 115.800003 116.330002 114.760002 116.150002 28781900 115.648597
- 2017-01-04 115.849998 116.510002 115.750000 116.019997 21118100 115.519154
- 2017-01-05 115.919998 116.860001 115.809998 116.610001 22193600 116.106611
- 2017-01-06 116.779999 118.160004 116.470001 117.910004 31751900 117.401002
- 2017-01-09 117.949997 119.430000 117.940002 118.989998 33387600 118.476334
- 2017-01-10 118.769997 119.379997 118.300003 119.110001 24462100 118.595819
- In [12]: def func(idx, row):
- ...: print(idx, row['Open'], row['High'], row['Low'], row['Close'])
- ...: # здесь делаете все ваши вычисления, присвоения, etc. ...
- ...:
- In [13]: for idx, r in df.iterrows():
- ...: func(idx, r)
- ...:
- 2017-01-03 00:00:00 115.800003 116.330002 114.760002 116.150002
- 2017-01-04 00:00:00 115.849998 116.510002 115.75 116.019997
- 2017-01-05 00:00:00 115.919998 116.860001 115.809998 116.610001
- 2017-01-06 00:00:00 116.779999 118.160004 116.470001 117.910004
- 2017-01-09 00:00:00 117.949997 119.43 117.940002 118.989998
- 2017-01-10 00:00:00 118.769997 119.379997 118.300003 119.110001
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement