I've been trying to simulate some Monte Carlos simulations lately and came across numpy.random
. Checking the documentation of the exponential generator I've noticed that that's a warning in the page, which tells that
Generator.exponential should be used for new code.
Althought that, numpy.random.exponential
still works, but I couldn't run the Generator
counterpart. I've been getting the following error:
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-14-c4cc7e61aa98> in <module>
----> 1 np.random.Generator.exponential(2, 1000)
TypeError: descriptor 'exponential' for 'numpy.random._generator.Generator' objects doesn't apply to a 'int' object
My questions are:
What's the difference between these 2?
How to generate a sample with
Generator
?
\begin{frame} \begin{figure} \includegraphics<1>{example-image-a} \includegraphics<2>{example-image-b} \caption{text} \end{figure} \end{frame}
would be easier?\only<1>{text first slide}\only<2>{text second slide}
is easier? (manipulating the counter to decrease the figure number is a bit risky because you'll break cross references)