-
-
Notifications
You must be signed in to change notification settings - Fork 46.9k
maths\jaccard_similarity.py
does not validate input and can divide by zero
#6916
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
Labels
Comments
maths\jaccard_similarity.py
can divide by zeromaths\jaccard_similarity.py
does not validate input and can divide by zero
what do you want to return from the function when the length of union set is 0 ? |
CoderRounak
added a commit
to CoderRounak/Python
that referenced
this issue
Oct 10, 2022
Please don't beg me to assign you. I am handling this myself. |
That commit does not solve the issue! |
14 tasks
CenTdemeern1
added a commit
to CenTdemeern1/TheAlgorithms_Python
that referenced
this issue
Oct 11, 2022
@dhruvmanila told me to commit these here so here we go Fixes TheAlgorithms#6916 among other issues
Hello, |
No, go away, spambot. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Repository commit
51dba4d
Python version (python --version)
Python 3.10.2
Dependencies version (pip freeze)
pip==22.2.2
setuptools==60.10.0
wheel==0.37.1
Expected behavior
According to

CONTRIBUTING.md
, aValueError
should be raised in the case of erroneous input.Actual behavior
This code makes no effort to check the input, and this can result in a zero division when given empty lists as input:

The text was updated successfully, but these errors were encountered: