Advertisement

使用sklearn进行特征离散化处理(LabelEncoder)

阅读量:
复制代码
    import pandas as pd
    import numpy as np
    vg_df = pd.read_csv('vgsales.csv', encoding = 'ISO-8859-1')
    vg_df[['Name', 'Platform', 'Year', 'Genre', 'Publisher']].iloc[1:7]
    
    
      
      
      
      
    
在这里插入图片描述
复制代码
    genres = np.unique(vg_df['Genre'])
    genres
    
    
      
      
    

array([‘Action’, ‘Adventure’, ‘Fighting’, ‘Misc’, ‘Platform’, ‘Puzzle’,
‘Racing’, ‘Role-Playing’, ‘Shooter’, ‘Simulation’, ‘Sports’,
‘Strategy’], dtype=object)

复制代码

全部评论 (0)

还没有任何评论哟~