how to filter out rows from a dataframe in python code example Example: filter rows pandas newdf = df[(df.origin == "JFK") & (df.carrier == "B6")]