如下所示: #coding:utf8 import pandas as pd import numpy as np from pandas import Series,DataFrame # 如果有id列,则需先删除id列再进行对应操作,最后再补上 # 统计的时候不需要用到id列,删除的时候需要考虑 # delete row def row_del(df, num_percent, label_len = 0): #print list(df.count(axis=1)) col_num = len(list(list(df.values)[1])) - label_len # -1为考