Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- File "C:UsersBWrightDocumentsPython_CodesHDR_Analysis_alternate_merge.py", line 297, in <module>
- Compare(results_file)
- File "C:UsersBWrightDocumentsPython_CodesHDR_Analysis_alternate_merge.py", line 193, in Compare
- elif row[2][:18] != row[3][:18] and row[2][-8:] != row[3][-8:]:
- TypeError: 'float' object has no attribute '__getitem__'
- [![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
- import pandas as pd
- from pandas import DataFrame as df
- from pandas import Series
- import os
- import re
- summary_file = open(summary_file_filepath, "a+")
- temp = open(temp_file, "r")
- data1 = pd.read_csv(csv, index_col=False)
- df1 = df(data1)
- constants_count = 0
- constants_match_count = 0
- incomplete_constants_match_count = 0
- variable_count = 0
- variable_match_count = 0
- incomplete_variable_match_count = 0
- for row in df1.itertuples():
- if row[1] in static_files:
- if row[2] != row[3]:
- incomplete_constants_match_count = incomplete_constants_match_count + 1
- summary_file.write('Incomplete match: %s : %s'%(row[2], row[3]))
- summary_file.write('n')
- summary_file.write('n')
- elif row[2][:18] != row[3][:18] and row[2][-8:] != row[3][-8:]:
- summary_file.write('Incomplete Match: %s : %s'%(row[2], row[3]))
- summary_file.write('n')
- summary_file.close()
- print('Completed comparison')][1]][1]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement