diff --git a/tableone.py b/tableone.py index 546afa9..c26d838 100644 --- a/tableone.py +++ b/tableone.py @@ -483,7 +483,7 @@ def _create_significance_table(self,data): # if categorical, create contingency table elif is_categorical: catlevels = sorted(data[v].astype('category').cat.categories) - grouped_data = pd.crosstab(data[self._groupby],data[v]) + grouped_data = pd.crosstab(data[self._groupby].rename('_groupby_var_'),data[v]) min_observed = grouped_data.sum(axis=1).min() # minimum number of observations across all levels