I think you mean,
newlist = [y for y in industrylist if y.cap < x]
otherwise you've got a list of caps, not a list of objects with the
cap attribute.
On Thu, 10 Mar 2005 12:10:31 -0800, James Stroud <[EMAIL PROTECTED]> wrote:
> newlist = [y.cap for y in industrylist if y.cap < x]
>
> On Thursd
newlist = [y.cap for y in industrylist if y.cap < x]
On Thursday 10 March 2005 12:00 pm, Leeds, Mark wrote:
> 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
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