[SciPy-User] covariance mtrix returns inf

Daπid davidmenhur at gmail.com
Sat Feb 8 10:39:56 EST 2014


On 8 February 2014 16:23, Gabriele Brambilla <gb.gabrielebrambilla at gmail.com
> wrote:

> the problem was that I mistake that b that should be a d!
> but I am curious how do you discover it?it was the last thing at which I
> was thinking about...
>

And that is exactly why you didn't see it. :)

Most bugs are one of three types: missuse of libraries (because one didn't
understand correctly how to use them), actual bugs in the library, and
wrong assumtpions on the code.

When debugging, we make assumptions on the code (for exaple, I assume that
the line zeroenemy.append(i) works perfectly, ie, there is no bug in
Python's append). For someone unfamiliar with the code, making less
assumptions is more natural. When the assumptions you make are invalid,
bugs appear; when you no longer make those assumptions, bugs are obvious.

Sometimes it helps to explain the problem to someone else, walking through
the code. Even if that person doesn't know how to program, or what is it
about, the sheer act of explaining will help you realise what are your
assumptions and investigate if they are actually true.

Actually, many people when facing a bug, they explain the situation to a
teddy bear or a rubber duck (
http://en.wikipedia.org/wiki/Rubber_duck_debugging) [my personal preference
is a platypus plushie]. Even if they are not very talkative, they can stare
at you while you figure out what was your wrong assumption. Still, this
will not help if the bug actually where in Scipy, but it could help you
narrow down the problem, test the function, and see that it was actually
buggy.


/David.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.scipy.org/pipermail/scipy-user/attachments/20140208/b751d5e3/attachment.html>


More information about the SciPy-User mailing list