tompollard / tableone

Create "Table 1" for research papers in Python
https://pypi.python.org/pypi/tableone/
MIT License
161 stars 38 forks source link

Getting the error 'reindex() got an unexpected keyword argument "axis"' when running tableone() for any dataset #56

Closed theonesp closed 6 years ago

theonesp commented 6 years ago

I am getting the error:

 ---------------------------------------------------------------------------
 TypeError                                 Traceback (most recent call last)
 <ipython-input-9-96bcc7e5935a> in <module>()
 ----> 1 TableOne(data)

 ~\Anaconda3\lib\site-packages\tableone.py in __init__(self, data, columns, categorical, groupby, nonnormal, pval, pval_adjust, isnull, ddof, labels, sort, limit, remarks)
     153 
     154         # combine continuous variables and categorical variables into table 1
 --> 155         self.tableone = self._create_tableone(data)
     156         # self._remarks_str = self._generate_remark_str()
     157 

 ~\Anaconda3\lib\site-packages\tableone.py in _create_tableone(self, data)
     715             table = table.reindex(cols, axis=1, level=1)
     716         else:
 --> 717             table = table.reindex(cols, axis=1)
     718 
     719         return table

 ~\Anaconda3\lib\site-packages\pandas\core\frame.py in reindex(self, index, columns, **kwargs)
    2731     def reindex(self, index=None, columns=None, **kwargs):
    2732         return super(DataFrame, self).reindex(index=index, columns=columns,
 -> 2733                                               **kwargs)
    2734 
    2735     @Appender(_shared_docs['reindex_axis'] % _shared_doc_kwargs)

 ~\Anaconda3\lib\site-packages\pandas\core\generic.py in reindex(self, *args, **kwargs)
    2492         if kwargs:
    2493             raise TypeError('reindex() got an unexpected keyword '
 -> 2494                             'argument "{0}"'.format(list(kwargs.keys())[0]))
    2495 
    2496         self._consolidate_inplace()

 TypeError: reindex() got an unexpected keyword argument "axis"
theonesp commented 6 years ago

uptading pandas solved it: https://github.com/dask/dask/pull/2814

tompollard commented 6 years ago

thanks @theonesp, we'll update the dependency to Pandas 0.2.1