Background: I was hoping to generate a new column named: datasample based on another column named: end_bin from a table.
Question: Is there a way to return the max value in each row of the new column if the value is repeated in the previous column.
Expected result:
end_bin | datasample |
---|---|
6 | 1 |
8 | 1 |
10 | 1 |
2 | 3 |
3 | 1 |
2 | 3 |
2 | 3 |
I couldnt find a method to do this in pandas, any help is appreciated:)