In [ ]:
df_encoded = pd.get_dummies(iris_df, columns=["variety"], dtype=int, prefix_sep=".")

df_encoded.head()
Out[ ]:
sepal.length sepal.width petal.length petal.width encoded.variety variety.Setosa variety.Versicolor variety.Virginica
60 5.0 2.0 3.5 1.0 1 0 1 0
62 6.0 2.2 4.0 1.0 1 0 1 0
119 6.0 2.2 5.0 1.5 2 0 0 1
68 6.2 2.2 4.5 1.5 1 0 1 0
41 4.5 2.3 1.3 0.3 0 1 0 0