pandas filter by two columns (python)
问题 I have a pandas DataFrame (df) with many columns, two of which are "Year" and "col_1" I also have a extraction criteria summarised in a list(Criteria): [1234,5432,...,54353,654,1234]. I would like to extract the subset of this DataFrame if the following criteria are met: ((df.Year==1990) & (df.col_1>=Criteria[0])) or ((df.Year==1991) & (df.col_1>=Criteria[1])) or ((df.Year==1992) & (df.col_1>=Criteria[2])) or ... ((df.Year==2010) & (df.col_1>=Criteria[20])) or ((df.Year==2011) & (df.col_1>