This should be rather simple, I would like to expand rows of my data set. The criteria to expand the rows is equal to a value in a specified column. In my code below that column is row_nbr2. Currently I can expand my rows the way I want however, the functions deletes all but two columns. I have two different ways of expanding my data set:
I am grouping by id, creating a new column called 'md' and expanding the rows equal to the value in the row_nbr2 column.