I have a dataframe look like this:
import pandas import numpy as np df = DataFrame(np.random.rand(4,4), columns = list(\'abcd\')) df a b
I think a nice solution is with the function filter of pandas and regex (match everything except "b"):
df.filter(regex="^(?!b$)")