I have a dataframe looks like this:
EXEC_FULLNAME YEAR BECAMECEO
CO_PER_ROL
5622 Ira A. Eichner 1992 19550101
5622 Ira A. Eichner 1993 19550101
5622 Ira A. Eichner 1994 19550101
5623 David P. Storch 1994 19961009
5623 David P. Storch 1995 19961009
5623 David P. Storch 1996 19961009
For the YEAR column, I want to add year columns (1993, 1994..., 2009) to the original dataframe. For example, if a YEAR value for a row is 1992, then the value in the 1992 column should be 1 otherwise 0 for that row.
I used a for loop, but it seems to run forever as I have a large dataset.