This is the look of my DataFrame
:
StateAb GivenNm Surname PartyNm PartyAb ElectedOrder
35 WA Joe BULLOCK Australian Labor Party ALP 2
36 WA Michaelia CASH Liberal LP 3
37 WA Linda REYNOLDS Liberal LP 4
38 WA Wayne DROPULICH Australian Sports Party SPRT 5
39 WA Scott LUDLAM The Greens (WA) GRN 6
and I want to list a list of senators whose surname is more than 9 characters long.
So I think the code should be like this:
df[len(df.Surname) > 9]
but this raises a KeyError
, where did I go wrong?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…