mirror of
https://github.com/Telecominfraproject/wlan-lanforge-scripts.git
synced 2025-11-02 19:58:03 +00:00
changes csv to final output version
Signed-off-by: Dipti <dipti.dhond@candelatech.com>
This commit is contained in:
@@ -637,17 +637,21 @@ class LFCliBase:
|
||||
return df.to_excel(output_f, index=False)
|
||||
if output_f == 'df':
|
||||
return df
|
||||
supported_formats = ['csv', 'json', 'stata', 'pickle','html']
|
||||
#for format in supported_formats:
|
||||
# if output_file_type.lower() == format:
|
||||
# return exec('df.to_' + x + '("'+file_name'")')
|
||||
if output_f == 'json':
|
||||
return df.to_json(output_f)
|
||||
if output_f == 'stata':
|
||||
return df.to_stata(output_f)
|
||||
if output_f == 'pickle':
|
||||
return df.to_pickle(output_f)
|
||||
if output_f == 'html':
|
||||
return df.to_html(output_f)
|
||||
|
||||
#takes any format of a file and returns a dataframe of it
|
||||
def file_to_df(self,file_name):
|
||||
return pd.read_csv(file_name)
|
||||
#get difference of all common columns in 2 dataframes. store in
|
||||
def compare_two_df(self,dataframe_one=None,dataframe_two=None):
|
||||
pass
|
||||
#get the columns to be compared
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1331,7 +1331,10 @@ class L3CXProfile(LFCliBase):
|
||||
#df to final report file output if necessary
|
||||
if output_format.lower() != 'csv':
|
||||
dataframe_output = pd.read_csv(report_file)
|
||||
self.df_to_file(dataframe=dataframe_output, output_f=output_format)
|
||||
final_file = self.df_to_file(dataframe=dataframe_output, output_f=output_format)
|
||||
#save final file output
|
||||
#print(report_file)
|
||||
|
||||
|
||||
def refresh_cx(self):
|
||||
for cx_name in self.created_cx.keys():
|
||||
|
||||
Reference in New Issue
Block a user