def up(x):
x_up = pd.DataFrame()
for i in range(len(x["SUN_ALT"])):
if i < len(x["SUN_ALT"]):
if x.iat[i,7] > x.iat[i+1,7]:
x_up.append(x.iloc[i,:])
return x_up
data_2009_target_up = pd.DataFrame()
data_2009_target_up = up(data_2009_target)
data_2009_target #数据的样子
FOC_RA FOC_DEC FOC_ROLL SAT_ALT EULER1 EULER2 EULER3 SUN_ALT TIMES DIST_PCU_IN_I
4 266.872864 -28.443785 266.472351 575.067200 266.872864 118.443787 183.527634 8.667719 2009-09-25 13:53:19 16.139700
20 266.872803 -28.443741 266.472351 574.989929 266.872803 118.443741 183.527664 7.671290 2009-09-25 13:53:35 16.513500
36 266.872772 -28.443697 266.472229 574.906555 266.872772 118.443695 183.527756 6.674752 2009-09-25 13:53:51 16.015100
52 266.872681 -28.443659 266.472137 574.820374 266.872681 118.443657 183.527878 5.678271 2009-09-25 13:54:07 15.765900
68 266.872650 -28.443705 266.472107 574.731567 266.872650 118.443703 183.527893 4.681874 2009-09-25 13:54:23 15.765900
33366 rows × 10 columns