summaryrefslogtreecommitdiff
path: root/numpy/random
Commit message (Collapse)AuthorAgeFilesLines
...
| * MAINT, DOC: discard repeated wordsDimitri Papadopoulos2022-01-134-4/+4
| |
| * Merge pull request #20643 from bashtage/experiment-array-cons-checkSebastian Berg2022-01-101-3/+19
| |\ | | | | | | PERF: Optimize array check for bounded 0,1 values
| | * PERF: Optimize array check for bounded 0,1 valuesKevin Sheppard2021-12-221-3/+20
| | | | | | | | | | | | Optimize frequent check for probabilities when they are doubles
| * | DOC: fix broken documentation references in mtrand.pyxAndy Wharton2022-01-021-42/+42
| | | | | | | | | | | | | | | | | | Change Generator.*: -> random.Generator.*: Partial fix for #13114
| * | Merge pull request #20380 from WarrenWeckesser/doc-fix-mvn-exampleMatti Picus2021-12-242-10/+56
| |\ \ | | | | | | | | DOC: random: Fix a comment and example in the multivariate_normal docstring
| | * | DOC: random: Tweak notation in multivariate_normal docstrings for consistency.warren2021-12-052-2/+2
| | | |
| | * | DOC: random: Add more details to the bivariate normal example.warren2021-12-052-6/+40
| | | |
| | * | Merge branch 'main' into doc-fix-mvn-examplewarren2021-12-035-12/+29
| | |\ \
| | * | | DOC: random: Replace the last multivariate_normal example with a plot.warren2021-12-032-8/+20
| | | | |
| | * | | DOC: random: Fix a comment and example in the multivariate_normal docstring.warren2021-11-152-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | | The covariance matrix is the identity, so the standard deviation of each component is 1.0.
| * | | | Merge pull request #20652 from BvB93/styCharles Harris2021-12-238-256/+229
| |\ \ \ \ | | | | | | | | | | | | STY: Use PEP 585 and 604 syntaxes throughout the .pyi stub files
| | * | | | STY: Use subscriptable `collections.abc` types over the generic aliases in …Bas van Beek2021-12-233-5/+5
| | | | | |
| | * | | | STY: Use subscriptable `builtins` types over the generic aliases in `typing`Bas van Beek2021-12-234-55/+49
| | | | | |
| | * | | | STY: Replace `Union` with the `|` operatorBas van Beek2021-12-227-71/+55
| | | | | |
| | * | | | STY: Replace `Optional` with the `|` operatorBas van Beek2021-12-223-152/+147
| | | |_|/ | | |/| |
| * | | | PERF: Speed up check_constraint checksKevin Sheppard2021-12-221-2/+3
| |/ / / | | | | | | | | | | | | | | | | | | | | Remove python api calls from check_constraint xref #20636
| * | | BUG: random: Check 'writeable' flag in 'shuffle' and 'permuted'.warren2021-12-184-0/+27
| | | |
| * | | BUG: Protect kahan_sum from empty arraysKevin Sheppard2021-12-171-0/+15
| | |/ | |/| | | | | | | Return a default value when passed an empty array
| * | BUG: Protect divide by 0 in multinomial (#20490)Kevin Sheppard2021-12-022-7/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Guard against empty pvals closes #20483 * MAINT: Correct exception type Raise TypeError for enhanced backward compat when pvals is scalar
| * | DOC: Fix a typo in docstring of MT19937Raphael Kruse2021-11-221-1/+1
| | |
| * | Merge pull request #20409 from mattip/setuptools3Ralf Gommers2021-11-201-0/+1
| |\ \ | | | | | | | | MAINT: import setuptools before distutils in one `np.random` test
| | * | MAINT: import setuptools beforew distutilsmattip2021-11-191-0/+1
| | |/
| * | ENH: provide a convenience function to replace npy_load_module (#20395)Matti Picus2021-11-191-4/+4
| |/ | | | | | | | | | | | | `load_module` is deprecated since python 3.4 and will be removed in python 3.12. Use `exec_module` instead. Provide a convenience function in `distutils.misc_utils` instead of `npy_load_module` from `compat.py3k`.
| * DOC: Fix formatting of a code exampleEero Vaher2021-11-151-0/+1
| | | | | | | | | | | | One of the code examples in the docstring of `numpy.random.Generator.multivariate_normal()` was not being displayed properly in the built documentation.
| * ENH: random: Add broadcast support to Generator.multinomial (#16740)Kevin Sheppard2021-11-123-45/+178
| | | | | | | | xref github issue #15201
| * Merge pull request #20314 from WarrenWeckesser/float32-rand-unused-bitSebastian Berg2021-11-123-6/+21
| |\ | | | | | | BUG: Get full precision for 32 bit floating point random values.
| | * BUG: Get full precision for 32 bit floating point random values.warren2021-11-063-6/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The formula to convert a 32 bit random integer to a random float32, (next_uint32(bitgen_state) >> 9) * (1.0f / 8388608.0f) shifts by one bit too many, resulting in uniform float32 samples always having a 0 in the least significant bit. The formula is corrected to (next_uint32(bitgen_state) >> 8) * (1.0f / 16777216.0f) Occurrences of the incorrect formula in numpy/random/tests/test_direct.py were also corrected. Closes gh-17478.
| * | DOC: Fix math formatting for zipf docstringwarren2021-11-112-2/+2
| | |
| * | DOC: random: Copy-edit zipf docstring: zipf is a discrete distribution.warren2021-11-112-12/+14
| | |
| * | DOC: random: Update the zipf example for the legacy RandomState method.warren2021-11-111-9/+17
| | |
| * | DOC: random: Fix a mistake in the zipf example.Warren Weckesser2021-11-111-10/+17
| |/ | | | | | | | | | | | | | | | | | | There was a mistake in the code that generated the plot in the zipf docstring. The Riemann zeta function is `scipy.special.zeta`, not `scipy.special.zetac`. I also tweaked the sample parameters and the plot code so the plot is a bit more informative.
| * DOC: Fix random.power Raises description (#20205)jessijzhao2021-10-272-2/+2
| | | | | | Current documentation for random.power and random.Generator.power states that ValueError is raised if a < 1; however the power function distribution only supports strictly positive a > 0 and raises ValueError if a <= 0. Fixed documentation to reflect this.
| * DOC: Updated random.uniform docstring parameter description (#20146)Arushi Sharma2021-10-262-3/+8
| | | | | | | | | | | | | | Add note to the description of the \"high\" parameter to indicate that it is possible for the value to be included in the returned values due to floating point precision, despite the fact that it represents an open interval. Co-authored-by: Ross Barnowski <rossbar@berkeley.edu>
| * Apply suggestions from code reviewMatthew Brett2021-10-261-0/+2
| | | | | | Co-authored-by: Matti Picus <matti.picus@gmail.com>
| * Allow clib callable build flagsMatthew Brett2021-10-231-1/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | At the moment, we are guessing whether we have the MSVC compiler, by looking at what Python was originally compiled for. That works only if we are using the same compiler, but this is not the case when we compile with e.g. mingw-w64 using Python.org Python. Unfortunately, at the time we are specifying build flags, we don't know what compiler we are using. Allow build flags to clib to be callables that return lists of strings, instead of strings, where the callables can do work like inspecting the compiler, at build time. Use this to check for MSVC at build time, when specifying the `/GL-` flag. See gh-9977 for a related discussion about these flags.
| * Merge pull request #20071 from alessiamarcolini/refactorCharles Harris2021-10-221-1/+1
| |\ | | | | | | MAINT: Remove unused imports and remove duplicated tests
| | * MAINT: remove unused importsAlessia Marcolini2021-10-081-1/+1
| | |
| * | BUG: Correct incorrect advance in PCG with emulated int128Kevin Sheppard2021-10-062-2/+23
| |/ | | | | | | | | | | | | Correct incorrect implemetation of carry in PCG64 and PCG64DXSM when advancing more than 2**64 steps closes #20048
| * DOC: Fix typos in the random and f2py documentation. (#20004)MalikIdreesHasanKhan2021-10-011-1/+1
| | | | | | * Fix typos
| * BUG: Remove double case to char in favor of PyArray_BYTESKevin Sheppard2021-09-282-4/+4
| | | | | | | | | | | | | | Replace pattern of casting PyArray_DATA to size_t then char in favor of direct use of PyArray_BYTES closes #19941
| * MAINT: random: Use expm1 where appropriate.warren2021-09-231-3/+3
| |
| * DOC: Typos found by codespellDimitri Papadopoulos2021-09-211-1/+1
| |
| * Merge pull request #19810 from charris/update-some-includesCharles Harris2021-09-031-1/+1
| |\ | | | | | | MAINT: Minor include rationalizations.
| | * MAIN: Minor include rationalization.Charles Harris2021-09-031-1/+1
| | | | | | | | | | | | | | | | | | | | | - Replace "Python.h" by <Python.h> - Replace "structmember.h" by <structmember.h> - Replace <npy_config> by "npy_config" - Define PY_SSIZE_T_CLEAN before all Python.h includes in .c files.
| * | MAINT: Drop .pyi code-paths specific to Python 3.7Bas van Beek2021-08-307-48/+7
| |/
| * MAINT: Avoid use of confusing compat aliases.Antony Lee2021-08-242-2/+2
| | | | | | | | | | | | | | | | | | As of Py3, np.compat.unicode == str, but that's not entirely obvious (it could correspond to some numpy dtype too), so just use plain str. Likewise for np.compat.int. tests are intentionally left unchanged, as they can be considered as implicitly testing the np.compat.py3k interface as well.
| * index_tricks.py file not modifiedshubham119411402021-08-193-6/+6
| |
| * ENH: Add support for windows on arm targets (#19513)Niyas Sait2021-07-271-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * add support for windows on arm targets * Philox: Use _umulh intrinsic for ARM64 target * CPU Detection: Refactor to avoid separate pre-processor definition for WoA * adapt test_dragon4 to avoid using pow (**) to workaround issue in windows C RT for arm64 * Update numpy/core/include/numpy/npy_cpu.h Co-authored-by: Matti Picus <matti.picus@gmail.com> * add release note for numpy windows/arm64 support * Update 19513.new_feature.rst Co-authored-by: Matti Picus <matti.picus@gmail.com> Co-authored-by: Charles Harris <charlesr.harris@gmail.com>
| * BUG: Seed random state in test_vonmises_large_kappa_range.Charles Harris2021-07-271-0/+1
| | | | | | | | | | This makes the test reproducible. See comments on failing test in #19540.
| * Merge pull request #19559 from BvB93/pytestMatti Picus2021-07-261-0/+4
| |\ | | | | | | ENH: Add annotations for `__path__` and `PytestTester`