df to file fully implemented and working

Signed-off-by: Dipti <dipti.dhond@candelatech.com>
This commit is contained in:
Dipti
2021-02-17 01:36:24 -08:00
parent 336241ff77
commit 9db0c32b38
3 changed files with 15 additions and 42 deletions

View File

@@ -1214,8 +1214,7 @@ class L3CXProfile(LFCliBase):
supported_formats = ['csv', 'json', 'stata', 'pickle','html']
for format in supported_formats:
if compared_report.lower() == format:
#exec('df.to_' + x + '("' + report_file + '",index=False' + ')')
#previous_data_df= read_csv()
pass
#================== Step 1, set column names and header row
@@ -1305,7 +1304,6 @@ class L3CXProfile(LFCliBase):
for key in port_mgr_values_dict.keys():
renamed_port_cols['port mgr - ' +key]=port_mgr_values_dict[key]
merge.update(renamed_port_cols)
for name in header_row[2:-3]:
temp_list.append(merge[name])
csvwriter.writerow(temp_list)
@@ -1332,7 +1330,7 @@ class L3CXProfile(LFCliBase):
#df to final report file output if necessary
if output_format.lower() != 'csv':
self.df_to_file(dataframe=pd.read_csv(report_file), output_f=output_format, save_path=report_file.replace('csv',output_format,1))
self.df_to_file(dataframe=pd.read_csv(report_file), output_f=output_format, save_path=report_file)
def refresh_cx(self):