summaryrefslogtreecommitdiff
path: root/numpy/random/mtrand
Commit message (Collapse)AuthorAgeFilesLines
* BUG: One element array inputs get one element arrays returned in np.randomgfyoung2016-01-241-187/+188
| | | | | | | | | | | | | | | 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-231-6/+9
| | | | | | 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.
* 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-161-17/+28
| | | | | | | | | | | | 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-101-0/+12
|
* 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-035-45/+694
|\ | | | | ENH: Add dtype argument to random.randint.
| * 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.
* | MAINT: Cleaned up unused variables and spelling mistakes in np.random modulesgfyoung2015-12-291-5/+0
|/
* ENH: Allow random_integers to include the maximum np.iinfo('l').maxgfyoung2015-12-281-31/+35
| | | | | | | 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]
* 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.
* MAINT: random: allow nonc==0 in noncentral_chisquare.Evgeni Burovski2015-11-022-4/+7
| | | | | 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: adjust tolerance for validating the sum of probs in random.choicealex2015-07-291-1/+7
|
* 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-101-1/+14
| | | | Fixes #5851
* DOC: improve the vonmises docstring examplealex2015-04-291-5/+5
|
* BUG: Fixes random.noncentral_chisquare when 0 < df <= 1behzad nouri2015-04-272-8/+15
| | | | 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-031-2/+2
|
* 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
| |
* | Merge pull request #5388 from sturlamolden/mtrand-bugfix-threadsafeJulian Taylor2014-12-231-7/+11
|\ \ | |/ | | | | BUG: Make RandomState.set_state and RandomState.get_state threadsafe
| * BUG: make set_state and get_state threadsafeSturla Molden2014-12-231-7/+11
| |
* | DOC : do not abuse enumeration for return typesThomas A Caswell2014-12-121-5/+5
| | | | | | | | | | change '{ndarray, float}' -> 'ndarray or float' as {} are for when the value is an enumeration
* | Update docstring for multivariate_normal().chebee7i2014-11-101-4/+6
| | | | | | | | | | | | The change is to make a stronger statement that the covariance matrix must be positive-semidefinite and that if it is not, then the results are not guaranteed across NumPy versions.
* | Merge pull request #5140 from pyhits/5136Julian Taylor2014-09-301-1/+4
|\ \ | | | | | | | | | BUG: ImportError: No module named thread
| * | BUG: ImportError: No module named threadUlrich Seidl2014-09-301-1/+4
| |/ | | | | | | Fixes #5136. Import dummy_threading if importing threading fails.
* | Throws if range is too large for 'random.uniform'Masud Rahman2014-09-281-2/+10
| | | | | | | | | | | | | | | | This fixes issue #2138 by checking that the range (i.e. high - low) is finite before invoking `rk_uniform`. A test case was added to ensure valid ranges do not throw, but invalid ranges do.
* | Merge pull request #4937 from charris/pep8-numpy-randomJulian Taylor2014-08-231-3/+3
|\ \ | | | | | | Pep8 numpy random
| * | BUG: Fix None comparison giving FutureWarning in choice function.Charles Harris2014-07-311-3/+3
| |/ | | | | | | | | This is in numpy/random/mtrand/mtrand.pyx where the choice function was using comparisons of the form `None != p`.
* | DOC: document broadcastable lam parameter of poissonJulian Taylor2014-06-111-2/+7
|/ | | | closes gh-4526