Impute categorical missing values in scikit-learn

I’ve got pandas data with some columns of text type. There are some NaN values along with these text columns. What I’m trying to do is to impute those NaN’s by sklearn.preprocessing.Imputer (replacing NaN by the most frequent value). The problem is in implementation.
Suppose there is a Pandas dataframe df with 30 columns, 10 of which are of categorical nature.
Once I run: