I have a pandas dataframe that looks like this:
x_cor
y_cor
893.200012 1
893.299988 17
893.400024 41
893.500000 39
893.599976 40
893.700012 36
893.799988 2
893.900024 13
894.000000 44
894.099976 43
894.200012 74
894.299988 88
894.400024 78
894.500000 132
894.599976 180
894.700012 178
What I want to do is to select certain rows, according to a condition, and to create 2 different dataframes out of it(one of which is comprised of the rows that meet the condition and the other of which consists of the rows that don't meet the condition). The condition is whether or not the x_cor value of each row is bigger than the preceding and subseqent x_cor values.
For example, the 3rd row 893.400024 41 meets the condition because the previous row's x_cor is 17 and the next row's x_cor is 39, which are smaller than 41.
I think it would be inefficient if I used loops with iloc or ix. What would be a better way to do this?