diff --git a/setup.py b/setup.py index fabd908..abbfebe 100644 --- a/setup.py +++ b/setup.py @@ -17,7 +17,7 @@ # Versions should comply with PEP440. For a discussion on single-sourcing # the version across setup.py and the project code, see # https://packaging.python.org/en/latest/single_source_version.html - version='0.5.14', + version='0.5.15', description='TableOne', long_description=long_description, diff --git a/tableone.py b/tableone.py index 1ff71f5..c6d0978 100644 --- a/tableone.py +++ b/tableone.py @@ -5,7 +5,7 @@ """ __author__ = "Tom Pollard , Alistair Johnson" -__version__ = "0.5.14" +__version__ = "0.5.15" import pandas as pd from scipy import stats @@ -656,7 +656,12 @@ def _create_tableone(self,data): The complete table one. """ if self._continuous and self._categorical: - table = pd.concat([self.cont_table,self.cat_table],sort=False) + + # support pandas<=0.22 + try: + table = pd.concat([self.cont_table,self.cat_table],sort=False) + except: + table = pd.concat([self.cont_table,self.cat_table]) elif self._continuous: table = self.cont_table elif self._categorical: @@ -699,7 +704,12 @@ def _create_tableone(self,data): n_row = pd.DataFrame(columns = ['variable','level','isnull']) n_row.set_index(['variable','level'], inplace=True) n_row.loc['n', ''] = None - table = pd.concat([n_row,table],sort=False) + + # support pandas<=0.22 + try: + table = pd.concat([n_row,table],sort=False) + except: + table = pd.concat([n_row,table]) if self._groupbylvls == ['overall']: table.loc['n','overall'] = len(data.index)