選取失蹤的小狗
回到我們裝載在 mpr 的失蹤小狗 DataFrame。來選取幾筆不同的列,進一步了解其他失蹤的狗狗。
本練習屬於課程
Python 的資料科學入門
練習說明
- 選取
Age大於2的狗。 - 選取
Status等於Still Missing的狗。 - 選取所有
Dog Breed不等於Poodle的狗。
動手互動練習
試著完成這個範例程式碼,體驗一下這個練習。
# Select the dogs where Age is greater than 2
greater_than_2 = mpr[mpr.Age ____ 2]
print(greater_than_2)
# Select the dogs whose Status is equal to Still Missing
still_missing = mpr[____ ____ ____]
print(still_missing)
# Select all dogs whose Dog Breed is not equal to Poodle
not_poodle = ____
print(not_poodle)