Skip to content

Commit

Permalink
convert df to snake case data_frame
Browse files Browse the repository at this point in the history
  • Loading branch information
Coen Claus committed Aug 25, 2023
1 parent 4c73abd commit 419d2af
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions operator.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,8 +163,8 @@ def __init__(self, context):
ifc_propertyset_name=property_set,
ifc_property_name=property_name)[0]))

df = pd.DataFrame(ifc_dictionary)
self.df = df
data_frame = pd.DataFrame(ifc_dictionary)
self.data_frame = data_frame

print (time.perf_counter() - start_time, "seconds for the dataframe to be created")
wm.progress_end()
Expand Down Expand Up @@ -301,13 +301,13 @@ def create_spreadsheet(self, context):
spreadsheet_filepath = str(IfcStore.path).replace('.ifc','.xlsx')

writer = pd.ExcelWriter(spreadsheet_filepath, engine='xlsxwriter')
construct_data_frame.df.to_excel(writer, sheet_name=prop.prop_workbook, startrow=1, header=False, index=False)
construct_data_frame.data_frame.to_excel(writer, sheet_name=prop.prop_workbook, startrow=1, header=False, index=False)
worksheet = writer.sheets[prop.prop_workbook]

(max_row, max_col) = construct_data_frame.df.shape
(max_row, max_col) = construct_data_frame.data_frame.shape

column_settings = []
for header in construct_data_frame.df.columns:
for header in construct_data_frame.data_frame.columns:
column_settings.append({'header': header})

worksheet.add_table(0, 0, max_row, max_col - 1, {'columns': column_settings})
Expand All @@ -327,7 +327,7 @@ def create_spreadsheet(self, context):

spreadsheet_filepath = str(IfcStore.path).replace('.ifc','.ods')
writer = pd.ExcelWriter(spreadsheet_filepath, engine='odf')
construct_data_frame.df.to_excel(writer, sheet_name=prop.prop_workbook, startrow=0, header=True, index=False)
construct_data_frame.data_frame.to_excel(writer, sheet_name=prop.prop_workbook, startrow=0, header=True, index=False)
worksheet = writer.sheets[prop.prop_workbook]
writer.close()

Expand Down

0 comments on commit 419d2af

Please sign in to comment.