Python: Filter Data idx = df_2017Prod_weight[‘YEAR’]==’2017′ df_2017Prod_weight_1=df_2017Prod_weight[idx]