I have col1 in a pandas df. I want to make col2:
col1 col2
1 1
1 2
1 3
1 4
2 2
2 3
2 4
3 3
3 4
4 4
In other words, for each distinct value in col1 I want col2 to be increasing integers that start with the value in col1 and counts up by one until there are no more rows.
The data is structured in a way so that max(col1) = 2450:
when col1 = 1, there are 2450 rows
when col1 = 2, there are 2449 rows
when col1 = 2450, there is 1 row
JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)