From 65733a5b0a8eba99d0029342e302e2538e357bcc Mon Sep 17 00:00:00 2001 From: Tom Pollard Date: Fri, 7 Jun 2024 00:25:47 -0400 Subject: [PATCH] refactor for conciseness. --- tableone/tableone.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/tableone/tableone.py b/tableone/tableone.py index f3901df..c61a2ea 100644 --- a/tableone/tableone.py +++ b/tableone/tableone.py @@ -238,11 +238,7 @@ def __init__(self, data: pd.DataFrame, # if categorical is set to None, try to automatically detect # if empty list is provided, assume there are no categorical variables. - if categorical is None: - self._categorical = detect_categorical(data[self._columns], groupby) - else: - self._categorical = categorical - + self._categorical = detect_categorical(data[self._columns], groupby) if categorical is None else categorical self._order = order_categorical(data, order) self._alt_labels = rename