-
Notifications
You must be signed in to change notification settings - Fork 42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TypeError: Int64: converted = maybe_downcast_numeric(result, dtype, do_round) #141
Comments
We found this error in https://github.com/MIT-LCP/hack-aotearoa/blob/master/03_summary_statistics.ipynb. Looking at it a little more closely, the following chunk is fine: import pandas as pd
from tableone import TableOne, load_dataset
d = {'col1': [1, 2, 4, 5],
'col2': [3, 4, 5, 6],
'outcome': [0,1,1,0]}
df = pd.DataFrame(data=d)
df.dtypes
# col1 int64
# col2 int64
# outcome int64
# dtype: object
TableOne(df, columns=['col1', 'col2'], groupby='outcome')
# works fine Converting one of the int64 to Int64 raises the error: df2 = df.astype({"col1": "Int64"})
TableOne(df2, columns=['col1', 'col2'], groupby='outcome') |
The error is raised for |
Bumping pandas fixed the issue: #165 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When run in a Colab notebook (specifically https://github.com/MIT-LCP/hack-aotearoa/blob/main/03_summary_statistics.ipynb), the following chunk raises a data type error (related to Int64 formatted values).
The text was updated successfully, but these errors were encountered: