I'm using this to conditionally select rows of column:
X.loc[data['column'] == 1]
But I want to expand this condition to several columns. These columns have something in common: They contain a same string. So actually I have a column1, a column2, ... , column100 etc. and this condition should apply to all of these columns. Actually something like this (wildcard):
X.loc[data['column*'] == 1]
These conditions should be linked with OR. Any chance to do this easily?
numpy.any()Two questions I asked very similar to yours: stackoverflow.com/questions/43677505/… and stackoverflow.com/questions/42647710/…col_list, TryX.loc[(X[col_list] == 1).any(axis=1)].locis not needed