I have a dataframe with 1.5M rows and one column. It looks like:
I want to split the column 'jobroles' into multiple columns with 1s and 0s (hot-coding). Following is what I have tried so far:
df_bits = df['jobroles'].str.join(sep=',').str.get_dummies(sep=',')
But it is not just splitting on "," but each and every digit. For example, "2424638" gets split into "2", "3", "4", "6" and "8". Below the result I am getting.