I have a Pandas dataframe, old, like this:
col1 col2 col3
0 1 2 3
1 2 3 4
2 3 4 5
I want to make a new dataframe, new, that copies col2 from old and fills in -1 as dummy values for its other columns:
col2 new_col1 new_col3
0 2 -1 -1
1 3 -1 -1
2 4 -1 -1
I suppose I could do iterate row by row and fill in -1 for any column not in old but figure there must be a better, likely vectorized way.
Ideas?
Thanks!