處理多餘字元(I)
在這個練習中,你會處理 so_survey_df 的 RawSalary 欄,裡面包含受訪者的薪資,還帶有貨幣符號與逗號,例如 $42,000。從 Microsoft Excel 匯入資料時,你很常會遇到這種格式。
本練習屬於課程
Feature Engineering for Machine Learning in Python
動手互動練習
試著完成這個範例程式碼,體驗一下這個練習。
# Remove the commas in the column
so_survey_df['RawSalary'] = so_survey_df['RawSalary'].____(',', '')