<div dir="ltr">Sebastian,<div><br></div><div>I apologize, that did work. I forgot to autoreload. Can you explain why the original code did work at the debug prompt?</div><div><br></div><div>-Dave</div></div><div class="gmail_extra">
<br><br><div class="gmail_quote">On Sun, Sep 22, 2013 at 10:45 AM, David Reed <span dir="ltr"><<a href="mailto:david.reed.c@gmail.com" target="_blank">david.reed.c@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr">Thanks Sebastian, but still have same error. Also doesn't explain why it works when I run the same code at the debug prompt. Scratching my head on this one.<div><br></div><div>Dave</div></div><div class="HOEnZb">
<div class="h5"><div class="gmail_extra">
<br><br><div class="gmail_quote">On Sun, Sep 22, 2013 at 10:42 AM, Sebastian Berg <span dir="ltr"><<a href="mailto:sebastian@sipsolutions.net" target="_blank">sebastian@sipsolutions.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div>On Sun, 2013-09-22 at 10:21 -0400, David Reed wrote:<br>
> Hi,<br>
><br>
><br>
> I am getting a strange error when finding the minimum of a matrix.<br>
> The weird thing is I get this while running within iPython shell, and<br>
> if I do %debug and go to the line where this fails and run the command<br>
> `a = np.min(D, axis=0)`, I get no error.<br>
><br>
><br>
> Here is the trace:<br>
><br>
><br>
> draw_lines/main.pyc in haus_distance(A, B)<br>
> 28 D = D.reshape((len(A), None))<br>
> 29<br>
> ---> 30 a = np.min(D, axis=0)<br>
> 31<br>
> 32 # vp = np.max(np.min(D, axis=0))<br>
><br>
<br>
</div>There is an error in the reshape code. The real error is the None in<br>
your reshape right above, it should be -1.<br>
This is not surfaced correctly due to a bug in Reshape, but instead gets<br>
surfaced (somewhat randomly) lateron.<br>
<br>
- Sebastian<br>
<div><br>
><br>
> anaconda/lib/python2.7/site-packages/numpy/core/fromnumeric.pyc in<br>
> amin(a, axis, out, keepdims)<br>
> 1985 else:<br>
> 1986 return _methods._amin(a, axis=axis,<br>
> -> 1987 out=out, keepdims=keepdims)<br>
> 1988<br>
> 1989 def alen(a):<br>
><br>
><br>
> anaconda/lib/python2.7/site-packages/numpy/core/_methods.pyc in<br>
> _amin(a, axis, out, keepdims)<br>
> 12 def _amin(a, axis=None, out=None, keepdims=False):<br>
> 13 return um.minimum.reduce(a, axis=axis,<br>
> ---> 14 out=out, keepdims=keepdims)<br>
> 15<br>
> 16 def _sum(a, axis=None, dtype=None, out=None, keepdims=False):<br>
><br>
><br>
> TypeError: an integer is required<br>
><br>
><br>
><br>
><br>
</div>> _______________________________________________<br>
> NumPy-Discussion mailing list<br>
> <a href="mailto:NumPy-Discussion@scipy.org" target="_blank">NumPy-Discussion@scipy.org</a><br>
> <a href="http://mail.scipy.org/mailman/listinfo/numpy-discussion" target="_blank">http://mail.scipy.org/mailman/listinfo/numpy-discussion</a><br>
<br>
<br>
_______________________________________________<br>
NumPy-Discussion mailing list<br>
<a href="mailto:NumPy-Discussion@scipy.org" target="_blank">NumPy-Discussion@scipy.org</a><br>
<a href="http://mail.scipy.org/mailman/listinfo/numpy-discussion" target="_blank">http://mail.scipy.org/mailman/listinfo/numpy-discussion</a><br>
</blockquote></div><br></div>
</div></div></blockquote></div><br></div>