tompollard / tableone

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

NaN rows deleted in categorical option #80

Closed Ryo-F closed 5 years ago

Ryo-F commented 5 years ago

PR for #79 .

tompollard commented 5 years ago

Thanks for the contribution! Several tests are now failing with:

TypeError: ufunc 'isnan' not supported for the input types, and 
the inputs could not be safely coerced to any supported types 
according to the casting rule ''safe''

The problem is that np.isnan(None) raises an error. Replacing np.isnan with pd.isnull fixes the tests, so I'll merge and then add this fix.