I'm looking to add dataframe rows and edit a column when a condition is met. I want Column B to be only "1's". If the value is greater than one, then add length of rows equal to the number thats > 1, while keeping ColA sorted by date asc. Example below:
Original DF:
ColA ColB
2021-03-09 1
2021-03-09 3
2021-03-10 2
2021-03-10 1
2021-03-10 2
2021-03-11 2
Desired DF
ColA ColB
2021-03-09 1
2021-03-09 1
2021-03-09 1
2021-03-09 1
2021-03-10 1
2021-03-10 1
2021-03-10 1
2021-03-10 1
2021-03-10 1
2021-03-11 1
2021-03-11 1
any suggestions are much appreciated!