Oops, sorry about not replying to the list. I must have hit the wrong
button.

I'm terming a redundant list just like I posted in the original message:
[[1,2,3], [4,5,6],[1,2,3]]

[0][0] and [0][2] are redundant, so I only want to keep one of them.

Thanks again Luke.

On 12/15/06, Luke Paireepinart <[EMAIL PROTECTED]> wrote:

Chris Hengge wrote:
> Yes, we went over that a bit ago, but I wasn't sure if there were any
> different or more appropriate approaches to this when dealing with
> multidimensional lists.
>
Well, it depends what you term a redundant list.
Like, is
[[1,2,3],[3,2,1]]
a list with 1 unique elements or two?

If it is 1, then just sort all the lists before you check for redundancy.

I don't think there are any algorithms that are specific to lists of
lists, though there may be.
-Luke

P.S. please reply on-list :)
>
> On 12/15/06, *Luke Paireepinart* <[EMAIL PROTECTED]
> <mailto:[EMAIL PROTECTED]>> wrote:
>
>     Chris Hengge wrote:
>     > I've got a list of lists that looks like this
>     >
>     > [[1,2,3], [4,5,6],[1,2,3]]
>     >
>     > I'm looking for a good way to drop the redundant inner lists
>     > (thousands of inner lists)
>     >
>     > Someone either have a good way to tackle this? or willing to
>     point me
>     > in the right direction?
>     >
>     > Thanks!
>     >
>     Didn't we give multiple solutions to a similar problem with lists
>     with
>     redundant elements a few weeks ago?
>     Well, the solutions will be the same, regardless that the elements
>     inside are lists themselves.
>
>     HTH,
>     -Luke
>
>


_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

Reply via email to