On Nov 2, 9:45 pm, [EMAIL PROTECTED] wrote:
> Hello, I have been sorting a list of dicts using the following
> function:
>
> result_rs = sorted(unsort_rs, key=itemgetter(orderby))
>
> and this works fine. Now I am looking to perform a subsort as well.
> For example, I have this:
>
> test = [{'name'
On Nov 2, 3:36 pm, "Andrew Koenig" <[EMAIL PROTECTED]> wrote:
> <[EMAIL PROTECTED]> wrote in message
>
> news:[EMAIL PROTECTED]
>
> > I would want to sort by name first, then sub sort by location. Any
> > ideas? Thanks!
>
> In Python 2.3 and later, sorting is stable -- so you can sort successively
On Nov 2, 3:36 pm, "Andrew Koenig" <[EMAIL PROTECTED]> wrote:
> <[EMAIL PROTECTED]> wrote in message
>
> news:[EMAIL PROTECTED]
>
> > I would want to sort by name first, then sub sort by location. Any
> > ideas? Thanks!
>
> In Python 2.3 and later, sorting is stable -- so you can sort successively
<[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> I would want to sort by name first, then sub sort by location. Any
> ideas? Thanks!
In Python 2.3 and later, sorting is stable -- so you can sort successively
in reverse order. In other words, sort the list by location, then sort th
On Nov 2, 2:45 pm, [EMAIL PROTECTED] wrote:
> Hello, I have been sorting a list of dicts using the following
> function:
>
> result_rs = sorted(unsort_rs, key=itemgetter(orderby))
>
> and this works fine. Now I am looking to perform a subsort as well.
> For example, I have this:
>
> test = [{'name'
Hello, I have been sorting a list of dicts using the following
function:
result_rs = sorted(unsort_rs, key=itemgetter(orderby))
and this works fine. Now I am looking to perform a subsort as well.
For example, I have this:
test = [{'name': 'John Smith', 'location': 'CA',},{'name': 'John
Smith', '