From 89f17eb67879103fa36cb6f4e47925f3a989ce35 Mon Sep 17 00:00:00 2001 From: Dipti Date: Thu, 11 Feb 2021 11:02:03 -0800 Subject: [PATCH] start of comparison of 2 dataframes --- py-json/LANforge/lfcli_base.py | 8 +++++++- py-json/realm.py | 7 ++++--- py-scripts/test_ipv4_variable_time.py | 2 +- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/py-json/LANforge/lfcli_base.py b/py-json/LANforge/lfcli_base.py index 55582aef..4d78526f 100644 --- a/py-json/LANforge/lfcli_base.py +++ b/py-json/LANforge/lfcli_base.py @@ -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 diff --git a/py-json/realm.py b/py-json/realm.py index 489fe167..1c2ecfa6 100755 --- a/py-json/realm.py +++ b/py-json/realm.py @@ -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) diff --git a/py-scripts/test_ipv4_variable_time.py b/py-scripts/test_ipv4_variable_time.py index 4a59fdf0..8683c7f6 100755 --- a/py-scripts/test_ipv4_variable_time.py +++ b/py-scripts/test_ipv4_variable_time.py @@ -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})