Tuples from List

rshepard at nospam.appl-ecosys.com rshepard at nospam.appl-ecosys.com
Tue Feb 27 19:48:03 EST 2007


  While it should be easy for me to get what I need from a list, it's
proving to be more difficult than I expected.

  I start with this list:

[  6.24249034e-01+0.j   5.11335982e-01+0.j   3.67333773e-01+0.j
   3.01189122e-01+0.j   2.43449050e-01+0.j   1.82948476e-01+0.j
   1.43655139e-01+0.j   9.91225725e-02+0.j]

and I want a list of floats of only the first 6 digits for each value. If I
write:
	for i in listname:
	    print i

I get this:

(0.624249034424+0j)
(0.511335982206+0j)
(0.367333773283+0j)
(0.301189121704+0j)
(0.243449050439+0j)
(0.182948475822+0j)
(0.14365513894+0j)
(0.0991225725344+0j)

  I know it's embarrassingly simple, but the correct syntax eludes my
inexperienced mind. What I want is a list [0.62424, 0.51133, ...] so that I
can normalize those values.

  What is the correct syntax, please?

Rich



More information about the Python-list mailing list