fileName = file_name
csvfile = open(fileName , 'rb') # 打开csv文件
reader = pd.read_csv(csvfile) # 读取文件内容
# print(reader['label'].value_counts())
aps = reader['label'].value_counts()
one = (aps== 1) ###
# print(aps[one])
reader = reader[(~reader['label'].isin(list(aps[one].index)))]
# print(reader['U_CODE'].value_counts())
reader.to_csv(outputFile,index=0)
最后
以上就是追寻航空最近收集整理的关于python 去掉只出现一次的类别的全部内容,更多相关python内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复