Skip to content
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

contingency_table computed from compute_contingency_table doesn’t contain both True and False for the observed or the simulated series #183

Closed
xfeng2021 opened this issue Mar 2, 2022 · 1 comment · Fixed by #184
Assignees
Labels
bug Something isn't working

Comments

@xfeng2021
Copy link

The following line in function compute_contingency_table:

ctab = pd.crosstab(observed, simulated, dropna=False)
produces ctab containing only True or False for either the observed or the simulated series? It would cause the error in ctab.loc.

Could you add a solution to handle such situation?

@jarq6c jarq6c self-assigned this Mar 2, 2022
@jarq6c jarq6c added the bug Something isn't working label Mar 2, 2022
@jarq6c
Copy link
Collaborator

jarq6c commented Mar 3, 2022

Verified if either of the input categorical series contain only True or False, then compute_contingency_table fails with a KeyError for the missing boolean category.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants