This is the look of my DataFrame:
StateAb GivenNm Surname PartyNm PartyAb ElectedOrder
35 WA Joe BULLOCK
The correct way to filter a DataFrame based on the length of strings in a column is
df[df['Surname'].str.len() > 9]
df['Surname'].str.len() creates a Series of lengths for the surname column and df[df['Surname'].str.len() > 9] filters out the ones less than or equal to 9. What you did is to check the length of the Series itself (how many rows it has).