Tuples from List

rshepard at nospam.appl-ecosys.com rshepard at nospam.appl-ecosys.com
Tue Feb 27 20:47:22 EST 2007


On 2007-02-28, Robert Kern <robert.kern at gmail.com> wrote:

> No, that's a numpy array.

Robert,

  That's where I went off. I forgot that I'm still dealing with a 1D NumPy
array and not a list. No wonder I had such fits!

> Those aren't tuples, but complex numbers.

  I have not seen the 'j' suffix before. That was throwing me.

> # Extract the real components (since the imaginary components are all 0):
> eigvals = eigvals.real

  That's so much easier than what I ended up doing, which was creating
another variable and assigning to that an explicit cast to real of the
array.

> # Normalize the eigenvalues:
> eigvals /= eigvals.sum()

  Now that's really nice!

Thank you very much for today's lessons. I really appreciate them

Rich



More information about the Python-list mailing list