number_of_declarations = df[df["测试1"]=="1"]["测试1"].astype("float").sum()#//中括号中为要求和的列 print(number_of_declarations) # df[df["测试1"]=="1"]["测试2"]=="这是一个测试" df.loc[df[df["测试1"] == '1'].index.tolist() ,'测试2'] = '新的值'
number_of_declarations = df[df["测试1"]=="1"]["测试1"].astype("float").sum()#//中括号中为要求和的列 print(number_of_declarations) # df[df["测试1"]=="1"]["测试2"]=="这是一个测试" df.loc[df[df["测试1"] == '1'].index.tolist() ,'测试2'] = '新的值'
本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。