From 5e243962ea8ed73c584a42ca07a7c3c4278a37b6 Mon Sep 17 00:00:00 2001 From: Nick Wardle Date: Wed, 22 May 2024 14:38:20 +0200 Subject: [PATCH] fix linter --- python/DataFrameWrapper.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/python/DataFrameWrapper.py b/python/DataFrameWrapper.py index db119a807b2..cb6d984879e 100644 --- a/python/DataFrameWrapper.py +++ b/python/DataFrameWrapper.py @@ -70,16 +70,18 @@ def Get(self, object_name): if not hasattr(self, "df"): raise AttributeError("Dataframe has not been loaded") - #index_labels, column_labels = object_name.split(",") - # Not necessary to include ":nominal,sum_w:sum_ww in every line + # index_labels, column_labels = object_name.split(",") + # Not necessary to include ":nominal,sum_w:sum_ww in every line # check if its not there and if so, add these default names of columns try: index_labels, column_labels = object_name.split(",") - except: - index_labels = object_name + except ValueError: + index_labels = object_name column_labels = "" - if len(column_labels)==0: column_labels="sum_w:sum_ww" - if len(index_labels.split(":")) < 3 : index_labels+=":nominal" + if len(column_labels) == 0: + column_labels = "sum_w:sum_ww" + if len(index_labels.split(":")) < 3: + index_labels += ":nominal" # Try to cast index_labels into self.df.index dtypes. Users can only # input index_labels as a string, but the dataframe might have other