Assuming I have a pandas dataframe like this
Date | Val1 | Val2 | Val 2 Greater than prev |
---|---|---|---|
2020-11-13 | 4 | 5 | NaN |
2020-11-14 | 6 | 9 | yes |
What udf could I write that would correctly fill in the Val 2 Greater than prev row?
I know how to solve this with a for loop and index access but assume a udf is easier.