Why is there no `mtrand.pxd`?
See original GitHub issueA thread from 2010 in python-cython-user
articulated my exact problem. Namely, I’m doing (things like) MCMC, and I want to use numpy’s MT implementation. Mostly, I do this because I don’t want multiple PRNG objects floating around my implementation. And, I’m using the RandomState
distributions in places other than the Cythonized code that needs access to the PRNG.
I searched the historical open and closed issues, but I never found a solution. Is there any reason, obvious or otherwise, why numpy does not include a .pxd
counter-part to mtrand.pyx
? If not, I’ll do this work and submit a PR. But, considering I often encounter this need, I’m assuming a well-justified reason for its absence.
Thanks!
Issue Analytics
- State:
- Created 7 years ago
- Comments:20 (20 by maintainers)
Top Results From Across the Web
Here's Why We Think Pioneer Natural Resources (NYSE:PXD ...
While we live in the present moment, there's little doubt that the future matters most in the investment decision process. So why not...
Read more >thread-safe random number generation with cython
In practical terms #3 is the most realistic one. However I am puzzled as to why mtrand is not exposed. If I am...
Read more >Here is What to Know Beyond Why Pioneer Natural ...
Pioneer Natural Resources (PXD) has been one of the stocks most watched by Zacks.com users lately. So, it is worth exploring what lies...
Read more >Pioneer Natural Resources: I Don't Buy $175 Stocks (NYSE ...
We think PXD is a well-run company with an outstanding asset base. The company is generating a lot of cash under the current...
Read more >numpy.random.mtrand.RandomState.normal
Draw random samples from a normal (Gaussian) distribution. The probability density function of the normal distribution, first derived by De ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@jbn do the solutions suggested in randomgen solve this need?
I’ve implemented some experiments along this line (both CFFI and Ctypes) in randomgen:
See, e.g.,
https://github.com/bashtage/randomgen/blob/master/randomgen/examples/numba/extending_distributions.py
and
https://bashtage.github.io/randomgen/extending.html