Tutorial by Examples: dummies

>>> df = pd.DataFrame({'Name':['John Smith', 'Mary Brown'], 'Gender':['M', 'F'], 'Smoker':['Y', 'N']}) >>> print(df) Gender Name Smoker 0 M John Smith Y 1 F Mary Brown N >>> df_with_dummies = pd.get_dummies(df, ...

Page 1 of 1