[Tutor] Sorting points on a 2D plane

Alan Gauld alan.gauld at btinternet.com
Thu Oct 29 01:56:53 CET 2009


"Robert Berman" <bermanrl at cfl.rr.com> wrote 

> constructed. My point of confusion is in ordering the points. Given a
> very simple example set of points:

> The arrangement should be,
> 
> 0 5
> 0 2
> 0 1
> 2 3
> 2 1
> 5 2
> 5 1
> 

You might find the itertools.groupby function does most of what you need?

HTH,

Alan G.



More information about the Tutor mailing list