Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #19037

Re: NaN, Null, and Sorting

References <mailman.4725.1326484286.27778.python-list@python.org> <67bd5e6b-a332-4d13-aad3-8de88b218ac5@z19g2000vbe.googlegroups.com>
Date 2012-01-16 21:57 +1100
Subject Re: NaN, Null, and Sorting
From Chris Angelico <rosuav@gmail.com>
Newsgroups comp.lang.python
Message-ID <mailman.4790.1326711481.27778.python-list@python.org> (permalink)

Show all headers | View raw


On Mon, Jan 16, 2012 at 9:22 PM, Eelco <hoogendoorn.eelco@gmail.com> wrote:
> What you want, conceptually, is a
> sorted list of the sortable entries, and a seperate list of the
> unsorted entries. Translated into code, the most pure solution would
> be to filter out the nanas/nulls in their own list first, and then
> sort the rest. If the interface demands it, you can concatenate the
> lists afterwards, but probably it is most convenient to keep them in
> seperate lists.

So... you split it into two lists, sort the two lists (one of which
can't be sorted), and then concatenate them. Sounds like the quicksort
algorithm.

ChrisA

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

NaN, Null, and Sorting Ethan Furman <ethan@stoneleaf.us> - 2012-01-13 11:04 -0800
  Re: NaN, Null, and Sorting Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2012-01-14 04:54 +0000
  Re: NaN, Null, and Sorting jmfauth <wxjmfauth@gmail.com> - 2012-01-13 23:43 -0800
  Re: NaN, Null, and Sorting Eelco <hoogendoorn.eelco@gmail.com> - 2012-01-16 02:22 -0800
    Re: NaN, Null, and Sorting Chris Angelico <rosuav@gmail.com> - 2012-01-16 21:57 +1100
    Re: NaN, Null, and Sorting Robert Kern <robert.kern@gmail.com> - 2012-01-16 11:07 +0000

csiph-web