8000 np.random.uniform does not check for invalid bounds when low= and high= are arraylike rather than scalar · Issue #8226 · numpy/numpy · GitHub
[go: up one dir, main page]

Skip to content
np.random.uniform does not check for invalid bounds when low= and high= are arraylike rather than scalar #8226
Closed
@alimuldal

Description

@alimuldal
In [1]: np.random.uniform(low=0, high=np.inf)
---------------------------------------------------------------------------
OverflowError                             Traceback (most recent call last)
<ipython-input-1-0b134c5277a5> in <module>()
----> 1 np.random.uniform(low=0, high=np.inf)

mtrand.pyx in mtrand.RandomState.uniform (numpy/random/mtrand/mtrand.c:17319)()

OverflowError: Range exceeds valid bounds

In [2]: np.random.uniform(low=[0], high=[np.inf])
Out[2]: array([ inf])

In [3]: np.random.uniform(low=[-np.inf], high=[np.inf])
Out[3]: array([ nan])

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0