df = pd.DataFrame({\'A\': [\'x\', \'y\', \'x\'], \'B\': [\'z\', \'u\', \'z\'],
\'C\': [\'1\', \'2\', \'3\'],
\'D\':[\'j\', \'l\',
Just select the two columns you want to .get_dummies() for - column names indicate source column and variable label represented as binary variable, and pd.concat() the original columns you want unchanged:
pd.concat([pd.get_dummies(df[['A', 'D']]), df[['B', 'C']]], axis=1)
A_x A_y D_j D_l B C
0 1.0 0.0 1.0 0.0 z 1
1 0.0 1.0 0.0 1.0 u 2
2 1.0 0.0 1.0 0.0 z 3