I have the following code
import pandas as pd private = pd.read_excel("file.xlsx","Pri") public = pd.read_excel("file.xlsx","Pub") private["ISH"] = private.HolidayName.str.lower().contains("holiday|recess") public["ISH"] = public.HolidayName.str.lower().contains("holiday|recess")
I get the following error:
AttributeError: 'Series' object has no attribute 'contains'
Is there a way to convert the 'HolidayName' column to lowercase and then check the regex ("Holiday|Recess") using .contains in one step?
source share