pandas dataframe logical operators code example
Example 1: or condition in pandas
df1 = df[(df.a != -1) & (df.b != -1)]
Example 2: pandas and operator
# Loads dataset
df = pd.read_csv('dataset.csv')
# Filter data
filtered_df = df.loc[(df['column1'] == var1) & (df['column2'] == var2)]