I want to create a subset dataframe containing all the rows when the row 'Name' is Sam or Frank. I run the following code but it returns no data:
df.loc[(df["Name"] == 'Sam') & (df["Name"] =='Frank'), :]
How can I change the code to work?
I want to create a subset dataframe containing all the rows when the row 'Name' is Sam or Frank. I run the following code but it returns no data:
df.loc[(df["Name"] == 'Sam') & (df["Name"] =='Frank'), :]
How can I change the code to work?