在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的系列,我该怎么办?
答案 0 :(得分: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