| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Fixes bug in np.random methods that would return scalars
when passed one-element array inputs. This is because
one-element ndarrays can be cast to integers / floats, which
is what functions like PyFloat_AsDouble do before converting
to the intended data type.
This commit changes the check used to determine whether the
inputs are purely scalar by converting all inputs to arrays
and checking if the resulting shape is an empty tuple (scalar)
or not (array).
Closes gh-4263.
|
|
|
|
|
|
|
| |
Clarified the output size depending on whether
scalar or non-scalar inputs are passed to
functions in mtrand.pyx that can broadcast
their arguments.
|
|
|
|
|
|
| |
Added a whole new suite of tests to ensure that
functions in mtrand.pyx which are broadcastable
actually broadcast their arguments properly.
|
|
|
|
|
|
|
| |
Refactored methods that broadcast arguments
together by finding additional common ground
between code in the if...else branches that
involved a size parameter being passed in.
|
| |
|
|
|
|
|
|
| |
Apparently gcc only specializes one branch (the last one) so I went for
another 33% performance increase (matching #6776) in what's likely the
most common use case.
|
|
|
|
|
|
|
|
|
|
|
|
| |
Only for 1d-ndarrays exactly, as subtypes (e.g. masked arrays) may not
allow direct shuffle of the underlying buffer (in fact, the old
implementation destroyed the underlying values of masked arrays while
shuffling).
Also handles struct-containing-object 1d ndarrays properly.
See #6776 for an earlier, less general (but even faster: ~6x)
improvement attempt, #5514 for the original issue.
|
| |
|
| |
|
| |
|
| |
|
|\
| |
| | |
ENH: Add dtype argument to random.randint.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
* check exceptions
* check extreme bounds are reachable
* check that all values are in the specified bounds
* check repeatability of sequences
More exact statistical tests would be nice, but that is another
project.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Random ndarrays of the following types can now be generated:
* np.bool,
* np.int8, np.uint8,
* np.int16, np.uint16,
* np.int32, np.uint32,
* np.int64, np.uint64,
* np.int_ (long), np.intp
The specification is by precision rather than by C type. Hence, on some
platforms np.int64 may be a `long` instead of `long long` even if the
specified dtype is `long long` because the two may have the same
precision. The resulting type depends on which c type numpy uses for the
given precision. The byteorder specification is also ignored, the
generated arrays are always in native byte order.
The dtype of the result could be made more explicit if desired without
changing the user visible results.
|
|\ \
| | |
| | | |
[FIX] fix NoseTester's raise_warning default
|
| |/ |
|
|/ |
|
|
|
|
|
|
|
| |
Redistributes the code between the randint and random_integers
methods so that we can generate integers up to and including
np.iinfo('l').max with random_integers, which previously
would have caused an OverflowError.
|
|
|
|
|
|
| |
Clarify that probabilities should be normalized.
[ci skip]
|
|
|
|
|
|
|
|
| |
Discuss a loaded dice with six sides. Also add the
text about handling of input probabilities, as written
by Robert Kern in gh-6612.
[ci skip]
|
| |
|
| |
|
| |
|
|
|
|
|
|
| |
numpy/random/mtrand/mtrand.pyx contains a line where cython fails to
compile, complaining “Pythonic division not allowed without gil”. By
running this code segment under cdivision(True), this problem is avoided.
|
|\
| |
| | |
BUG: Add choice and dirichlet to numpy.random.__all__.
|
| |
| |
| |
| | |
Closes #6602.
|
|/
|
|
|
| |
Noncentral chi-square reduces to a central chi-square, so
just defer to that.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
| |
Numpy will no longer support the bento build system, so remove the
associated files.
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
Most of these fixes involve putting blank lines around
.. versionadded:: x.x.x
and
.. deprecated:: x.x.x
Some of the examples were also fixed.
|
|
|
|
| |
Fixes #5851
|
| |
|
|
|
|
| |
Closes #5766.
|
| |
|
|
|
|
|
|
|
|
| |
- Spelling fixes
- Remove blank lines between references, and
- Some style fixes in examples.
[skip ci]
|
|
|
|
|
| |
Fixed a number of references that were malformatted and broken links.
Module still needs work, particularly in standardizing return values.
|
|
|
|
|
|
| |
Fixed some broken links, references, and missing values. Also reverted
some earlier edits to return value descriptions to make them less
confusing.
|
| |
|
| |
|
| |
|
|
|
|
| |
[ci skip]
|
| |
|
|\
| |
| |
| | |
BUG: Make RandomState.seed, RandomState.randint and RandomState.shuffle threadsafe
|
| | |
|