100,50,30,10,10]
# 在第0列处添加新列
df1.insert(0, '建筑编码',[1,2,2,3,4,4,5])
df1.loc[:,"new"] = np.arange(7)...按照原列序
df5_7=df5[df5.电耗量 > 80]# 选择df5.电耗量中>80的行
# df5[df5.建筑名称.isin(['B', 'C'])] #DataFrame 条件查找
#...# # 条件查找
df5_9=df5.动力用电.notnull() # Series类型 true与false的一列
# df5_9 df5['动力用电'].notnull() # Series...(("电耗量>60"))
#使用Numpy的内置where()函数,np.where(condition, value if condition is true, value if condition...:如何对字段打标签
#一般情况下,根据值大小,将样本数据划分出不同的等级
方法一:使用一个名为np.select()的函数,给它提供两个参数:一个条件,另一个对应的等级列表。