I am looking for a workaround in an issue I have with a pd.dataframe I am creating. I am looking to have values in my dataframe selected based on their string values.
Here is some example code
'Main.loc[Main['Discrepancy Description'].str.contains('seat',case=False),'Issue']='Seats'
This says any time the column "discrepancy description' contains "seat" to make the value of Issues equal to "Seats".
I am curious if there's a way to exclude other parameters? As in, have the code not return "Seat" if the string says "seat belt" or something similar. Is there a way to exclude other values? Thank you in advance.