Examples
import numpy as np
import pandas as pd
s = pd.Series(list('pqrp'))
pd.get_dummies(s)
s1 = ['p', 'q', np.nan]
pd.get_dummies(s1)
pd.get_dummies(s1, dummy_na=True)
df = pd.DataFrame({'P': ['p', 'q', 'p'], 'Q': ['q', 'p', 'r'],
'R': [2, 3, 4]})
pd.get_dummies(df, prefix=['col1', 'col2'])
pd.get_dummies(pd.Series(list('pqrpp')))
pd.get_dummies(pd.Series(list('pqrpp')), drop_first=True)
pd.get_dummies(pd.Series(list('pqr')), dtype=float)