summaryrefslogtreecommitdiff
path: root/numpy/random
Commit message (Collapse)AuthorAgeFilesLines
* BUG: One element array inputs get one element arrays returned in np.randomgfyoung2016-01-242-188/+274
| | | | | | | | | | | | | | | 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.
* DOC: Clarified output size for broadcastable mtrand.pyx functionsgfyoung2016-01-231-182/+243
| | | | | | | Clarified the output size depending on whether scalar or non-scalar inputs are passed to functions in mtrand.pyx that can broadcast their arguments.
* TST: Added broadcasting tests in test_random.pygfyoung2016-01-232-87/+644
| | | | | | Added a whole new suite of tests to ensure that functions in mtrand.pyx which are broadcastable actually broadcast their arguments properly.
* MAINT: Simplified mtrand.pyx helpersgfyoung2016-01-201-104/+74
| | | | | | | 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.
* Revert to non-generative test.Antony Lee2016-01-161-5/+4
|
* Top shuffle speed for machine-sized ints/floats.Antony Lee2016-01-161-8/+18
| | | | | | 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.
* MAINT: memcpy-based ~4x faster, typed shuffle.Antony Lee2016-01-162-40/+56
| | | | | | | | | | | | 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.
* DEP: Deprecate random_integersgfyoung2016-01-102-0/+28
|
* DOC: high arg is mandatory for mtrand._rand_int32ldoddema2016-01-041-7/+3
|
* MAINT: Fix notation in mtrand.pyx documentation.ldoddema2016-01-041-2/+2
|
* MAINT: Fix typos in 1.11.0-notes.rst and mtrand.pyx documentation.Charles Harris2016-01-031-1/+1
|
* Merge pull request #6910 from charris/add-64-bit-random-intCharles Harris2016-01-036-45/+771
|\ | | | | ENH: Add dtype argument to random.randint.
| * TST: Add tests for new randint functionality.Charles Harris2016-01-021-0/+77
| | | | | | | | | | | | | | | | | | | | * 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.
| * ENH: Add dtype argument to random.randint.Charles Harris2016-01-025-45/+694
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | Merge pull request #6901 from njsmith/test-warning-defaultsRalf Gommers2015-12-301-3/+3
|\ \ | | | | | | [FIX] fix NoseTester's raise_warning default
| * | [TST] Refactor new raise_warnings logic for subpackage test suitesNathaniel J. Smith2015-12-301-3/+3
| |/
* | MAINT: Cleaned up unused variables and spelling mistakes in np.random modulesgfyoung2015-12-292-6/+1
|/
* ENH: Allow random_integers to include the maximum np.iinfo('l').maxgfyoung2015-12-282-31/+46
| | | | | | | 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.
* DOC: Update example in np.random.multinomial.Charles Harris2015-12-181-10/+11
| | | | | | Clarify that probabilities should be normalized. [ci skip]
* DOC: typo in the docstring of random.multinomialEvgeni Burovski2015-12-181-2/+15
| | | | | | | | 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]
* MAINT: minor spelling and grammar correctionsgfyoung2015-12-161-3/+3
|
* Correct reference to Johnk's algorithmJohn Bjorn Nelson2015-12-151-1/+1
|
* Made changes in numpy/numpy/random/mtrand/matrand.pyxgopalmeena2015-12-151-1/+1
|
* BUG: Fix for #6719Gerrit Holl2015-11-251-1/+2
| | | | | | 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.
* Merge pull request #6614 from charris/update-random-allCharles Harris2015-11-021-0/+4
|\ | | | | BUG: Add choice and dirichlet to numpy.random.__all__.
| * BUG: Add choice and dirichlet to numpy.random.__all__.Charles Harris2015-11-021-0/+4
| | | | | | | | Closes #6602.
* | MAINT: random: allow nonc==0 in noncentral_chisquare.Evgeni Burovski2015-11-023-4/+14
|/ | | | | Noncentral chi-square reduces to a central chi-square, so just defer to that.
* DOC: fixing beta calculation for numpy.random,gumbeljason king2015-10-071-1/+1
|
* DOC: Update RandomState guarantee to be more explicit.Charles Harris2015-10-051-5/+8
|
* DOC: Add RandomState stability guarantee to RandomState documentation.mtran2015-10-041-0/+6
|
* DOC: Fix typo in Triangular Distribution PDFMaPePeR2015-09-081-1/+1
|
* MAINT: Remove bento related files.Charles Harris2015-08-292-47/+0
| | | | | Numpy will no longer support the bento build system, so remove the associated files.
* BLD: try_run fails on Python 3.5b4 for WindowsChristoph Gohlke2015-08-011-14/+1
|
* TST: fix OverflowError on win-amd64Christoph Gohlke2015-08-011-1/+1
|
* MAINT: adjust tolerance for validating the sum of probs in random.choicealex2015-07-292-2/+20
|
* DOC: Fix docstring warnings in documetation generation.Charles Harris2015-07-011-2/+2
| | | | | | | | | | | | 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.
* BUG: np.random.beta with small parameters produces NaNsJaime Fernandez2015-05-102-1/+22
| | | | Fixes #5851
* DOC: improve the vonmises docstring examplealex2015-04-291-5/+5
|
* BUG: Fixes random.noncentral_chisquare when 0 < df <= 1behzad nouri2015-04-273-8/+21
| | | | Closes #5766.
* MANT: Use labs, not fabs, for integer abs in distributions.cJaime Fernandez2015-04-231-1/+2
|
* DOC: Some cleanups of mtrand.pyx docstrings.Charles Harris2015-03-281-14/+8
| | | | | | | | - Spelling fixes - Remove blank lines between references, and - Some style fixes in examples. [skip ci]
* DOC: Minor edits to docstrings to improve consistency in the moduleGeorge Castillo2015-03-281-106/+128
| | | | | Fixed a number of references that were malformatted and broken links. Module still needs work, particularly in standardizing return values.
* DOC: Incremental improvement in random module docstringsGeorge Castillo2015-03-281-123/+146
| | | | | | Fixed some broken links, references, and missing values. Also reverted some earlier edits to return value descriptions to make them less confusing.
* DOC: Covariance matrix should be symmetricBlake Griffith2015-03-261-1/+1
|
* BUG: Fix potential overflows in rk_hypergeometric_hrua()Anton Ovchinnikov2015-03-032-2/+13
|
* DOC: correct erroneous description of Rayleigh distributionEric Firing2015-01-301-4/+4
|
* DOC: fix a few bugs in the random.pareto docstring. Closes gh-4181.Ralf Gommers2015-01-171-15/+15
| | | | [ci skip]
* DOC: style fixes for random.multivariate_normal docstring.Martin Thoma2015-01-071-8/+12
|
* Merge pull request #5390 from sturlamolden/mtrand-bugfix-threadsafeJulian Taylor2014-12-231-16/+22
|\ | | | | | | BUG: Make RandomState.seed, RandomState.randint and RandomState.shuffle threadsafe
| * BUG: make seed, randint and shuffle threadsafeSturla Molden2014-12-231-16/+22
| |