summaryrefslogtreecommitdiff
path: root/numpy/random
Commit message (Collapse)AuthorAgeFilesLines
* BUG: Check out requirements and raise when not satisfiedKevin Sheppard2021-04-072-9/+53
| | | | | | Check that out is C-contiguous when using user-supplied arguments closes #18704
* PERF: Use exponentials in place of inversionKevin Sheppard2021-03-225-10/+20
| | | | Use exponentials rather than generating exponentials via inversion
* MAINT: Add mising type to cdef statementKevin Sheppard2021-03-193-4/+4
| | | | | Add missing type to cdef statement Small spelling fix
* Merge pull request #18438 from seberg/shuffle-objectsCharles Harris2021-03-183-3/+41
|\ | | | | BUG: Correct shuffling of objects in 1-d array likes
| * STY: Fix hanging indentation.Charles Harris2021-03-171-3/+3
| |
| * STY: Break long line.Charles Harris2021-03-171-1/+3
| |
| * BUG: Correct shuffling of objects in 1-d array likesSebastian Berg2021-02-223-3/+39
| | | | | | | | | | | | | | | | | | While introducing the buffer fixed the in-place problem years ago, running valgrind (and masked arrays) pointed out to me that without the additional `...` NumPy will unpack and repack objects leading to slightly incorrect results. MAINT: Warn about shuffle bug instead of fixing it in old random API
* | Merge pull request #18635 from bashtage/random-integer-exception-defaultMatti Picus2021-03-182-10/+32
|\ \ | | | | | | ENH: Improve the exception for default low in Generator.integers
| * | ENH: Improve the exception for default low in Generator.integersKevin Sheppard2021-03-172-10/+32
| | | | | | | | | | | | | | | | | | | | | Improve the exception when low is 0 in case the single input form was used. closes #14333
* | | BUG: Use lop1p to improve numerical precisionKevin Sheppard2021-03-176-34/+71
| | | | | | | | | | | | | | | | | | | | | Use log1p(-x) instead of log(1 - x) Seperate legacy version from current closes #17020
* | | BUG: np.random: Use log1p to improve precisionEric Wieser2021-03-171-11/+11
|/ / | | | | | | This reduces the number of cases when floating point precision makes the argument to `log` become `0`
* | DOC: Consistently use rng as variable name for random generatorsTim Hoffmann2021-03-151-4/+4
| |
* | Merge pull request #18439 from WarrenWeckesser/random-choice-excCharles Harris2021-03-071-4/+6
|\ \ | | | | | | MAINT: random: Use 'from exc' when raising a ValueError in choice.
| * | MAINT: random: use 'from exc' instead of 'from None'; tweak error messages.Warren Weckesser2021-02-191-7/+7
| | |
| * | MAINT: random: Use 'from None' when raising a ValueError in choice.Warren Weckesser2021-02-181-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | Use 'from None' when the ValueError is raised when the first argument to `choice` is not an array and not an integer. Also fix the error message for the ValueError, and add a missing space to two other error messages.
* | | Port error to RandomStateKevin Sheppard2021-02-263-2/+23
| | |
* | | Address commentsKevin Sheppard2021-02-261-9/+9
| | |
* | | Accept suggestion Kevin Sheppard2021-02-261-1/+2
| | | | | | | | | | | | | | | Use if else. Co-authored-by: Eric Wieser <wieser.eric@gmail.com>
* | | ENH: Improve error message in multinomialKevin Sheppard2021-02-262-1/+21
| | | | | | | | | | | | | | | | | | | | | | | | Improve error message when the sum of pvals is larger than 1 when the input data is an ndarray closes #8317 xref #16732
* | | CLN: Move to legacy functionKevin Sheppard2021-02-264-20/+82
| | | | | | | | | | | | | | | | | | Avoid conditional compilation and move old version to legacy_vonmises Small clean up Additional comments
* | | BUG: Prevent RandomState from changingKevin Sheppard2021-02-266-19/+45
| | | | | | | | | | | | | | | | | | | | | | | | Apply vonmises fix only to Generator Add tests for correctness closes #17378 closes #17275
* | | Added test for [-np.pi, np.pi] range for the von mises distribution using ↵Raúl Montón Pinillos2021-02-263-0/+9
| | | | | | | | | | | | large values of kappa (>1e6)
* | | Fixed style and added check for bounds in [-pi,pi] interval.Raúl Montón Pinillos2021-02-261-6/+17
| | |
* | | Fixed Von Mises distribution for big values of kappa by falling back to a ↵Raúl Montón Pinillos2021-02-261-3/+8
| | | | | | | | | | | | normal distribution (which the von mises distribution converges to).
* | | Merge pull request #18433 from bashtage/randomstate-typingMatti Picus2021-02-245-130/+824
|\ \ \ | | | | | | | | ENH: Add typing for RandomState
| * | | BUG: Remove incorrect variable nameKevin Sheppard2021-02-241-1/+0
| | | | | | | | | | | | | | | | Remove incorrect variable name in randint
| * | | CLN: Clean up random typingKevin Sheppard2021-02-242-22/+7
| | | | | | | | | | | | | | | | | | | | Clean unnecessary definitions Fix small typing errors
| * | | Use {int_} for int return typesKevin Sheppard2021-02-241-1/+1
| | | |
| * | | Small fixesKevin Sheppard2021-02-243-7/+4
| | | |
| * | | BUG: Fix typing bugsKevin Sheppard2021-02-241-1/+1
| | | |
| * | | ENH: Add tests for RandomStateKevin Sheppard2021-02-241-4/+6
| | | |
| * | | BUG: Corect typing statements in mtrandKevin Sheppard2021-02-242-27/+64
| | | | | | | | | | | | | | | | | | | | Bring over changes from Generator to RandomState where appropriate Remove attributes not in RandomState
| * | | ENH/BUG: Improve definitions and fix bugsKevin Sheppard2021-02-241-33/+131
| | | | | | | | | | | | | | | | | | | | | | | | Add tests Fix related bugs Improve specificity of definitions
| * | | ENH/BUG: Add tests and correct typing issuesKevin Sheppard2021-02-244-31/+61
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Add tests for lower level components Correct errors found in testing Improve specificity of tests Other small fixes to docs and typing
| * | | MAINT: Restructure imports in pyi fileKevin Sheppard2021-02-241-51/+53
| | | |
| * | | ENH: Add typing for RandomStateKevin Sheppard2021-02-243-61/+605
| | | | | | | | | | | | | | | | | | | | Add typing for RandomState Small fixes to Generator's typing
* | | | DOC: Explaing differences in code paths in choiceKevin Sheppard2021-02-242-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Add explanation for different results when using user-specified probabilities even if uniform closes #18172
* | | | DOC: Correct poisson docstringKevin Sheppard2021-02-242-4/+6
|/ / / | | | | | | | | | closes #18314
* | | Merge pull request #18372 from lelayf/random-standard_t-docCharles Harris2021-02-232-30/+54
|\ \ \ | |_|/ |/| | DOC: improve standard_t example in numpy.random.
| * | Merge branch 'master' into random-standard_t-docFrançois Le Lay2021-02-1712-29/+828
| |\ \ | | |/
| * | Remove poorly cited referenceFrançois Le Lay2021-02-122-24/+16
| | | | | | | | | | | | | | | Clarify point about std computation Use absolute value for p-value computation of 2-tailed test
| * | DOC: improve standard_t example in numpy.random.François Le Lay2021-02-082-28/+60
| | | | | | | | | | | | | | | | | | This rewrite better reflects the cited reference R example by offering a 2-tailed test and more accurate language. Closes #18370.
* | | TST: Add test for shuffle warning and assert stacklevelSebastian Berg2021-02-191-0/+12
| | | | | | | | | | | | | | | | | | | | | The test checks that the warning originates in the correct file (test_random.py). I am not quite sure how safe the test is, though. Unfortunately, there is no "obvious" way to test stacklevels.
* | | BUG: fix stacklevel in warning within random.shuffleSebastian Berg2021-02-192-10/+12
| | | | | | | | | | | | | | | Cython does _not_ add a new stacklevel (at least at this time), so `stacklevel=1` (or ommiting it) is, maybe surprisingly, correct.
* | | MAINT: Correct code producing warningsKevin Sheppard2021-02-181-1/+1
| |/ |/| | | | | | | Cast to avoid warnings Correct function
* | ENH: Reorder bool and add scalar bool for integersKevin Sheppard2021-02-161-9/+18
| |
* | ENH: Add overloads to integersKevin Sheppard2021-02-151-7/+121
| |
* | ENH: Fix abstract integer useKevin Sheppard2021-02-151-2/+19
| | | | | | | | Replace with concrete types
* | ENH: Fix typingKevin Sheppard2021-02-151-2/+2
| | | | | | | | Correct specific typing and general typing
* | ENH: Update typingKevin Sheppard2021-02-151-2/+10
| | | | | | | | Update with latest suggestions