Guest User

Untitled

a guest
Feb 21st, 2018
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. def total_calc(n):
  2. input = pd.read_csv(file_name)
  3. input['calc'] = 0.0
  4. for index, row in input.iterrows():
  5.  
  6. # perform calculations
  7.  
  8. input.at[index, 'calc'] = calc_value
  9. input.to_csv(file_name, index=False)
  10.  
  11. def total_calc(i,n):
  12. input = pd.read_csv(file_name)
  13. input['calc'] = 0.0
  14. for index, row in input.iterrows():
  15.  
  16. # perform calculations
  17.  
  18. input.at[index+i, 'calc'] = calc_value
  19. input.to_csv(file_name, index=False)
  20.  
  21. total_calc(1,2)
  22. total_calc(2,8)
Add Comment
Please, Sign In to add comment