This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Problem in the documentation of numpy.random.randint in python 2.7
Type: behavior Stage: resolved
Components: Documentation Versions: Python 2.7
process
Status: closed Resolution: third party
Dependencies: Superseder:
Assigned To: docs@python Nosy List: Jay, docs@python, vstinner
Priority: normal Keywords:

Created on 2019-01-15 13:12 by Jay, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
sample.py Jay, 2019-01-15 13:12 Normal python code. Output on running on python 2.7 was 0.
Messages (2)
msg333701 - (view) Author: Jay (Jay) Date: 2019-01-15 13:12
Official Documentation of python 2.7 mentions that numpy.random.randint(a,b) will return a random integer from N such that a<=N<=b. But I have run the code and I have found that it never returns equal to b. So, what I did was I ran numpy.random.randint(0,1) for 50 milion times and finally printed the sum. 

The output was 0. 

I don't know if this a documentation or an implementation issue, but this is an issue which needs to be looked at. I am attaching the code that I ran.
msg333702 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2019-01-15 13:13
Sorry but this is the bug tracker of Python, not of numpy. Please use https://github.com/numpy/numpy/issues instead.
History
Date User Action Args
2022-04-11 14:59:10adminsetgithub: 79925
2019-01-15 13:13:49vstinnersetstatus: open -> closed

nosy: + vstinner
messages: + msg333702

resolution: third party
stage: resolved
2019-01-15 13:12:12Jaycreate