python 2.7 - How do I conditionally select a row in one pandas dataframe while obtaining a range from another dataframe? -
i need iterate on rows of sdata_long_periods obtain start , end of range of dates. need sdata within range "close" value such low value less 90% of "close" on start date. if found then, should "close" on day else should lowest value between start , end days.
i need rows in sdata_long_periods dataframe. not sure how apply lambda such can conditionally assign value column in sdata_long_periods.
sdata_long_periods: end date date 2017-08-18 2017-08-28 2017-08-23 2017-09-05 sdata: open high low close volume 50d 200d date 2017-08-16 101.84 102.65 101.72 102.20 6698783 105.67 107.02 2017-08-17 102.24 102.58 101.34 101.38 6612443 105.57 107.06 2017-08-18 101.32 101.74 100.66 100.70 6893916 105.50 107.11 2017-08-21 100.64 101.42 100.53 101.17 6492673 105.41 107.15 2017-08-22 101.41 102.91 101.17 102.77 6888650 105.33 107.20 2017-08-23 102.48 102.98 101.48 101.50 5954375 105.23 107.24 2017-08-24 101.82 102.03 101.43 101.52 6976592 105.13 107.28 2017-08-25 101.69 102.68 101.56 102.41 6186933 105.06 107.32 2017-08-28 102.49 102.85 102.08 102.56 5630425 105.00 107.36 2017-08-29 102.00 102.99 101.82 102.57 6011650 104.95 107.40 2017-08-30 102.48 103.45 102.48 102.87 6573211 104.93 107.42 2017-08-31 103.00 103.19 101.00 101.20 9823832 104.85 107.44 2017-09-01 101.65 101.92 101.36 101.50 7827433 104.80 107.46 2017-09-05 102.00 102.55 100.90 101.60 9592925 104.75 107.47 2017-09-08 96.49 97.49 96.26 97.07 13147662 104.58 107.46
Comments
Post a Comment