<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Wed, Jul 29, 2015 at 3:19 PM, ryguy7272 <span dir="ltr"><<a href="mailto:ryanshuell@gmail.com" target="_blank">ryanshuell@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I am using Spyder Python 2.7.  I'm running this sample code.<br>
import numpy as np<br>
import numpy.random as npr<br>
import matplotlib.pyplot as plt<br>
S0 = 100<br>
r = 0.05<br>
sigma = 0.25<br>
T = 30 / 365.<br>
I = 10000<br>
ST = S0 * np.exp((r - 0.5 * sigma ** 2) * T + sigma * np.sqrt(T) * npr.standard_normal(I))<br>
R_gbm = np.sort(ST - S0)<br>
plt.hist(R_gbm, bins=50)<br>
plt.xlabel('absolute return')<br>
plt.ylabel('frequency')<br>
plt.grid(True)<br>
<br>
I found it in a book, and I'm trying to run various samples of code, in an effort to learn Python.  So, I click the debug button, and this is what I get.<br>
> c:\users\rshuell001\untitled12.py(1)<module>()<br>
-> import numpy as np<br>
(Pdb)<br>
<br>
It seems like it doesn't really do anything.  So, I click the exit debug button and then click the run button and nothing happens.  I get nothing at all.  In the book, the author got a graph.  I get nothing.  I think, and I could be totally wrong, Python is sending something to a Console, but I can't tell where it goes.  I opened every Console I could find, and I still see nothing happening whatsoever.<br>
<br>
Any idea what's wrong here?<br><br></blockquote><div><br></div><div>First, you need to call plt.show() at the end in order to see anything.<br><br></div><div>Second, when you run the debugger it immediately waits for you to tell it what to do.  So you need to tell it continue running.  But normally you wouldn't run it in the debugger. <br></div></div><br></div></div>