DataFrame like this:
import pandas
df = pandas.DataFrame({'id':[1,2,3,4,5,6],'name':['test1','test2','test','D','E','F'],'sex':['man','woman','woman','man','woman','man']},index=['a','b','c','d','e','f'])
print(df)
print('*'*100)
I can drop the rows by index label:
df.drop(df[df.name.str.contains('test')|df.sex.str.contains('woman')].index,inplace=True)
print(df)
How can i find out the columns label which contains 'test' or 'woman' and remove the columns