How do I exclude a few columns from a DataFrame plot?

Note, a modification to @Chang She’s response, as of pandas 0.16, the - operator is scheduled for deprecation. The difference() method is encouraged in its place.

exclude = ['bad col1', 'bad col2']
df.loc[:, df.columns.difference(exclude)].hist() 

Update on deprecation:

df - df['A']

is now deprecated and will be removed in a future release. The
preferred way to replicate this behavior is

df.sub(df['A'], axis=0)

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)