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刪除。