Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def total_calc(n):
- input = pd.read_csv(file_name)
- input['calc'] = 0.0
- for index, row in input.iterrows():
- # perform calculations
- input.at[index, 'calc'] = calc_value
- input.to_csv(file_name, index=False)
- def total_calc(i,n):
- input = pd.read_csv(file_name)
- input['calc'] = 0.0
- for index, row in input.iterrows():
- # perform calculations
- input.at[index+i, 'calc'] = calc_value
- input.to_csv(file_name, index=False)
- total_calc(1,2)
- total_calc(2,8)
Add Comment
Please, Sign In to add comment