Full question-
Search each column in a DataFrame to determine when the first instance of a value greater than a value stored in the last row of each column in the DataFrame and output the index
Ex. of df.head():
Well A1 A2 A3 A4
Temperature
25.0 371.335253 360.026443 253.228769 593.436104
25.2 331.957145 332.224668 233.607595 561.057715
25.4 305.472591 303.777874 213.500582 535.310186
25.6 285.713623 274.069361 202.024427 515.261876
25.8 252.716374 254.610848 181.719415 488.988468
Ex. of df.tail():
Well A1 A2 A3 A4
Temperature
94.79 -441.775980 -664.549239 1060.674188 1158.481056
94.99 -492.189733 -709.521424 1029.628209 1087.625128
mean 280.759521 283.417750 201.471571 519.939366
std 72.404373 69.023406 45.447202 58.150127
4*std 570.377014 559.511373 383.260378 752.539875
I want to use the value of 4*std in A1 (570.37) and search starting from the top of the column for the first value greater than (570.37) in A1 and output the Temperature. I need to repeat this for all columns.
I would like the output as a new dataframe like this example below...I'm lost on how to construct this?
Well Temp
A1 26.0
A2 27.6
A3 26.8
... ...
H12 27.2
I would appreciate any help!