Python將列表中不一樣字符換爲不一樣數字

在作機器學習項目時,常常要將列表中不一樣字符換爲不一樣數字,好比:python ['Jogging' 'Jogging' 'Jogging' 'Jogging' 'Jogging' 'Jogging' 'Upstairs' 'Upstairs' 'Downstairs' 'Downstairs' 'Downstairs']app 轉換爲機器學習 [1 1 1 1 1 1 2 2 0 0 0]函數
相關文章
相關標籤/搜索