Skip to content

Commit

Permalink
fix dupe column name in crosstab. ref #62
Browse files Browse the repository at this point in the history
  • Loading branch information
tompollard committed May 23, 2018
1 parent d9ab6b3 commit 53cb6bf
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tableone.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 53cb6bf

Please sign in to comment.