Advertisement
Guest User

Untitled

a guest
Aug 20th, 2019
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.58 KB | None | 0 0
  1. File "C:UsersBWrightDocumentsPython_CodesHDR_Analysis_alternate_merge.py", line 297, in <module>
  2. Compare(results_file)
  3. File "C:UsersBWrightDocumentsPython_CodesHDR_Analysis_alternate_merge.py", line 193, in Compare
  4. elif row[2][:18] != row[3][:18] and row[2][-8:] != row[3][-8:]:
  5. TypeError: 'float' object has no attribute '__getitem__'
  6.  
  7. [![def Compare(csv): # Compare - Iterates through the .csv row by row, creating a temporary tuple with three 'elements': [1] Data_set_name [2] File_name_config and [3] File_name_temp
  8. import pandas as pd
  9. from pandas import DataFrame as df
  10. from pandas import Series
  11. import os
  12. import re
  13. summary_file = open(summary_file_filepath, "a+")
  14. temp = open(temp_file, "r")
  15. data1 = pd.read_csv(csv, index_col=False)
  16. df1 = df(data1)
  17. constants_count = 0
  18. constants_match_count = 0
  19. incomplete_constants_match_count = 0
  20. variable_count = 0
  21. variable_match_count = 0
  22. incomplete_variable_match_count = 0
  23.  
  24.  
  25. for row in df1.itertuples():
  26. if row[1] in static_files:
  27. if row[2] != row[3]:
  28. incomplete_constants_match_count = incomplete_constants_match_count + 1
  29. summary_file.write('Incomplete match: %s : %s'%(row[2], row[3]))
  30. summary_file.write('n')
  31. summary_file.write('n')
  32.  
  33. elif row[2][:18] != row[3][:18] and row[2][-8:] != row[3][-8:]:
  34. summary_file.write('Incomplete Match: %s : %s'%(row[2], row[3]))
  35. summary_file.write('n')
  36. summary_file.close()
  37. print('Completed comparison')][1]][1]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement