探索資料
做得很好!你已經掌握用於探索與準備監督式機器學習模型之資料集的關鍵技巧。接下來要把所學用在實作上。本練習中,你會探索電信流失資料集的關鍵特性。建議你在送出作答前,先逐行執行,這樣能先看到關於資料集的有用資訊。pandas 模組已經以 pd 載入。
原始的電信流失資料集 telco_raw 已為你載入成 pandas 的 DataFrame。你可以在主控台中先探索它,熟悉一下這個資料集。
本練習屬於課程
Python 的行銷機器學習
練習說明
- 印出
telco_raw的資料型別。 - 印出
telco_raw的前幾列。 - 印出
telco_raw每個欄位的不重複值個數。
動手互動練習
試著完成這個範例程式碼,體驗一下這個練習。
# Print the data types of telco_raw dataset
print(telco_raw.___)
# Print the header of telco_raw dataset
print(telco_raw.___())
# Print the number of unique values in each telco_raw column
print(telco_raw.___())