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


Groups > comp.lang.python > #19037

Re: NaN, Null, and Sorting

Path csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!weretis.net!feeder1.news.weretis.net!feeder.erje.net!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <rosuav@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.021
X-Spam-Evidence '*H*': 0.96; '*S*': 0.00; 'received:209.85.210.174': 0.13; 'received:mail-iy0-f174.google.com': 0.13; '16,': 0.15; 'mon,': 0.15; 'entries.': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'seperate': 0.16; 'sortable': 0.16; 'wrote:': 0.16; 'jan': 0.19; 'header:In-Reply-To:1': 0.22; 'interface': 0.23; 'translated': 0.23; 'pm,': 0.26; 'code,': 0.27; 'filter': 0.28; 'lists': 0.28; 'message-id:@mail.gmail.com': 0.28; 'pure': 0.32; 'list': 0.32; "can't": 0.32; 'sort': 0.32; 'to:addr :python-list': 0.33; 'probably': 0.35; 'lists,': 0.35; 'convenient': 0.36; 'two': 0.37; 'but': 0.37; 'received:google.com': 0.37; 'received:209.85': 0.38; 'received:209': 0.39; 'subject:: ': 0.39; 'to:addr:python.org': 0.40; 'most': 0.60; 'want,': 0.71; '(one': 0.73
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=+Pz7iNcjIsRIhWqZchmjqBo2UHoO8e6i8gx1xIAFX6E=; b=Hv/n/Bb7H6blBTbKGy5eWTFGVJ1fM1JRcpdZ34zlraxA29gN3J8tcFPmM91xHe6Rda 9in89UtGMj40E5ipOU+JOgTC3Soz5Kgp0L6tzhsn+CYbNCxLoBiVrf+LduLIyGWJbQNa MU5z/zGJ9/hK8yUGMyS75MUuDPIw7uDtGbc/A=
MIME-Version 1.0
In-Reply-To <67bd5e6b-a332-4d13-aad3-8de88b218ac5@z19g2000vbe.googlegroups.com>
References <mailman.4725.1326484286.27778.python-list@python.org> <67bd5e6b-a332-4d13-aad3-8de88b218ac5@z19g2000vbe.googlegroups.com>
Date Mon, 16 Jan 2012 21:57:59 +1100
Subject Re: NaN, Null, and Sorting
From Chris Angelico <rosuav@gmail.com>
To python-list@python.org
Content-Type text/plain; charset=ISO-8859-1
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.12
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.4790.1326711481.27778.python-list@python.org> (permalink)
Lines 14
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1326711481 news.xs4all.nl 6863 [2001:888:2000:d::a6]:52905
X-Complaints-To abuse@xs4all.nl
Xref x330-a1.tempe.blueboxinc.net comp.lang.python:19037

Show key headers only | 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