I am pulling two rows of data from a dataframe of 130 teams. When I search for a team, if that team is exclusive such as ‘Boise State’ it returns only one row, but if that team is not exclusive, such as ‘Florida’ it returns Florida, South Florida, Florida State, Florida Atlantic, etc.
How do I get it to pull only the name I input?
python #
‘’’
x = input("Enter the first team name: ")
y = input("Enter the second team name: ")
team_name1 = x
team_name2 = y
team_data1 = df[df[‘Team’].str.contains(team_name1, case=False, na=False)]
team_data2 = df[df[‘Team’].str.contains(team_name2, case=False, na=False)]
df1 = pd.concat([pd.DataFrame(team_data1), pd.DataFrame(team_data2)], axis=0)
print(df1)
‘’’