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

Problem - The truth value of an array with more than one elemnet is ambigous. #161

Open
filipy1 opened this issue May 6, 2024 · 3 comments

Comments

@filipy1
Copy link

filipy1 commented May 6, 2024

Hello appreciate the hard work and found the package really useful, recently thought i came across a problem I think might be some bug or functionality i cannot understand?

I follow the basic idea of creating a data set and a list of the categorical columns and providing that to the TableOne function without any additional conditions and I get the error message provided below, ill really appreciate if someone can clarify if its a bug or something on my side of things.

attached are snippets of the df, code and error

Screenshot 2024-05-06 at 14 52 33

Screenshot 2024-05-06 at 14 53 15

Screenshot 2024-05-06 at 14 52 54

@filipy1 filipy1 changed the title Problem - The truth value of an array with more than one elemnet is ambigous. Use a Problem - The truth value of an array with more than one elemnet is ambigous. May 6, 2024
@filipy1
Copy link
Author

filipy1 commented May 6, 2024

I'll add that this error pops up when I try to use a categorical list of columns, when I do not use it i get another error

Screenshot 2024-05-06 at 15 27 29

The way I somewhat managed to bypass the problem is by exporting my df to excel and importing it back to python and suddenly the error didn't occur

@tompollard
Copy link
Owner

@filipy1 are you able to share a dataset that i can use to reproduce this error?

@filipy1
Copy link
Author

filipy1 commented Jun 4, 2024

unfortunately this isn't a df I can just share, ill try and get around that, i can say i got around it a bit by letting the package decide what is categorical and what is numerical.

I also checked like a 100 times that I do the same thing as in all the other times I used the package (and still use without problems in smaller projects), I create a list like the tutorial of the different values I need, check typing and such and feed it to the package. I can have 2 python files open at the same time where in one I typed all the needed columns by hand (because it was only about 20 and was quicker and everything worked but when I used an automated script to slice and manipulate those same 20 columns and than fed them to the package it gives this error even tho typing and object wise everything is the same.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants