我有一個熊貓數據框,我想寫一個函數來幫助我總結每個負值,例如result1和每個正值作爲結果2。因此,基本上,這個功能應該遍歷列「total_load」 def total_battery(ok6, col_name='total_load'):
"""Return a dictionary with counts of occurrences."""
# Initialize an em
我想使用此代碼 import csv
with open('Trials/readtest.csv', mode='r') as infile:
reader = csv.reader(infile)
with open('Trials/readtest_2.csv', mode='w') as outfile:
writer = csv.writer(outf