FW: list reduction

Leeds, Mark mleeds at mlp.com
Thu Mar 10 15:00:54 EST 2005


 

I have a structure in python that I think is a list

with elements .Cap and .Ticker

where Cap is a float and Ticker is string.

 

So, I reference things like

industrylist[i].cap and industrylist[i].ticker

and this works fine.

 

What I want to do is reduce the list

so that it only keeps elements of the list

for which the cap is less than x where x is known ?

 

I think I need to use filter and lambda but

i've looked in the documentation

and I haven't been able to figure out

how to use it.

 

Apologies if this is a bad question.

 

                                    Thanks

 

 

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20050310/79a95f61/attachment.html>


More information about the Python-list mailing list