I can't figure it out why this does not work. The df2
dataframe should contain all the data from df which match two conditions..
df2 = df.loc[df['area'] == "north" & df['product'] == "a"]
I can't figure it out why this does not work. The df2
dataframe should contain all the data from df which match two conditions..
df2 = df.loc[df['area'] == "north" & df['product'] == "a"]
Either
df2=df.loc[df['area'] == "north"].loc[df['product'] == "a"]
or
df2 = df[(df["area"] == "north") & (df["product"] == "a")]
Would do the job.