2017-01-23 51 views
0

鑑於這種代碼在IPython中系列數超過一定數量

df1=df["BillingContactCountry"].value_counts() 
df1 

大我得到

United States      4138 
Germany       1963 
United Kingdom      732 
Switzerland       528 
Australia       459 
Canada        369 
Japan        344 
France        303 
Netherlands       285 

我想用數比303大的系列,我該怎麼辦?

回答

3

您需要boolean indexing

print (df1[df1 > 303]) 
United States  4138 
Germany   1963 
United Kingdom  732 
Switzerland  528 
Australia   459 
Canada    369 
Japan    344 
Name: BillingContactCountry, dtype: int64 
相關問題