Skip to content

Commit

Permalink
Merge pull request #963 from cms-analysis/nucleosynthesis-update-Data…
Browse files Browse the repository at this point in the history
…FrameWrapper

Remove default requirements from DataFrameWrapper
  • Loading branch information
anigamova authored May 30, 2024
2 parents 9405b07 + 5e24396 commit 52ae241
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion python/DataFrameWrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +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(",")
# 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 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"

# 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
Expand Down

0 comments on commit 52ae241

Please sign in to comment.