start of comparison of 2 dataframes

This commit is contained in:
Dipti
2021-02-11 11:02:03 -08:00
parent c06d936648
commit 89f17eb678
3 changed files with 12 additions and 5 deletions

View File

@@ -641,8 +641,14 @@ class LFCliBase:
#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
pass
#return compared_df

View File

@@ -1319,10 +1319,11 @@ class L3CXProfile(LFCliBase):
time.sleep(monitor_interval_ms)
csvfile.close()
#here, do column manipulations
#comparison to last report / report inputted
if compared_report is not None:
pass
#df to final report file output
compared_report_completed=self.compare_two_df(pd.read_csv(report_file), pd.read_csv(compared_report))
#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)

View File

@@ -142,7 +142,7 @@ def main():
optional.append({'name': '--layer3_cols', 'help': 'Columns wished to be monitored from layer 3 endpoint tab',
'default': ['name', 'tx bytes', 'rx bytes']})
optional.append({'name': '--port_mgr_cols', 'help': 'Columns wished to be monitored from port manager tab',
'default': ['ap', 'ip', 'rx bytes']})
'default': ['ap', 'ip', 'parent dev']})
optional.append(
{'name': '--compared_report', 'help': 'report path and file which is wished to be compared with new report',
'default': None})