I have a dataframe where if a specific string is in a row then print that value.
dataframe:
date floor
18:26:41 4th-floor
18:26:41 2nd-floor
18:26:41 4th-floor
18:26:41 4th-floor
Code I have tried:
for floor in df:
if df.floor.str.contains("4th-floor"):
print("success")