Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #74642
| Path | csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.fsmpi.rwth-aachen.de!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail |
|---|---|
| From | Johann Hibschman <jhibschman@gmail.com> |
| Newsgroups | comp.lang.python |
| Subject | Re: NaN comparisons - Call For Anecdotes |
| Date | Thu, 17 Jul 2014 11:12:28 -0400 |
| Organization | A noiseless patient Spider |
| Lines | 25 |
| Message-ID | <osx38e010kj.fsf@gmail.com> (permalink) |
| References | <53BC05FB.4050707@jmunch.dk> <53BD70F4.4000504@stoneleaf.us> <53BDAF90.8010709@jmunch.dk> <CAPM-O+yiioLm-UiV2fYqc2n9qZrN+_v6RkeqJ7mOQ3Kq+cH0CQ@mail.gmail.com> <mailman.11716.1404946997.18130.python-list@python.org> |
| Mime-Version | 1.0 |
| Content-Type | text/plain |
| Injection-Info | mx05.eternal-september.org; posting-host="bf8df648563a652600991a2f46263256"; logging-data="8619"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/Se16QT6mfwBqUSLWLaBFHmwU74Crb9EM=" |
| User-Agent | Gnus/5.13 (Gnus v5.13) Emacs/24.3 (windows-nt) |
| Cancel-Lock | sha1:V2huuyHdAzQ17D0k5xGTwFwDt7w= sha1:Clp2QnHpW8uP+zNiwAR7UOwuWQY= |
| Xref | csiph.com comp.lang.python:74642 |
Show key headers only | View raw
"Anders J. Munch" <2014@jmunch.dk> writes:
> So far I received exactly the answer I was expecting. 0 examples of
> NaN!=NaN being beneficial.
> I wasn't asking for help, I was making a point. Whether that will
> lead to improvement of Python, well, I'm not too optimistic, but I
> feel the point was worth making regardless.
Well, I just spotted this thread. An easy example is, well, pretty much
any case where SQL NULL would be useful. Say I have lists of borrowers,
the amount owed, and the amount they paid so far.
nan = float("nan")
borrowers = ["Alice", "Bob", "Clem", "Dan"]
amount_owed = [100.0, nan, 200.0, 300.0]
amount_paid = [100.0, nan, nan, 200.0]
who_paid_off = [b for (b, ao, ap) in
zip(borrowers, amount_owed, amount_paid)
if ao == ap]
I want to just get Alice from that list, not Bob. I don't know how much
Bow owes or how much he's paid, so I certainly don't know that he's paid
off his loan.
Cheers,
Johann
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Re: NaN comparisons - Call For Anecdotes "Anders J. Munch" <2014@jmunch.dk> - 2014-07-10 01:03 +0200
Re: NaN comparisons - Call For Anecdotes Johann Hibschman <jhibschman@gmail.com> - 2014-07-17 11:12 -0400
Re: NaN comparisons - Call For Anecdotes Chris Angelico <rosuav@gmail.com> - 2014-07-18 01:36 +1000
Re: NaN comparisons - Call For Anecdotes Johann Hibschman <jhibschman@gmail.com> - 2014-07-17 14:49 -0400
Re: NaN comparisons - Call For Anecdotes Chris Angelico <rosuav@gmail.com> - 2014-07-18 04:55 +1000
Re: NaN comparisons - Call For Anecdotes Marko Rauhamaa <marko@pacujo.net> - 2014-07-17 22:10 +0300
Re: NaN comparisons - Call For Anecdotes Ian Kelly <ian.g.kelly@gmail.com> - 2014-07-17 14:39 -0600
Re: NaN comparisons - Call For Anecdotes Marko Rauhamaa <marko@pacujo.net> - 2014-07-18 00:08 +0300
Re: NaN comparisons - Call For Anecdotes Ian Kelly <ian.g.kelly@gmail.com> - 2014-07-17 17:00 -0600
Re: NaN comparisons - Call For Anecdotes Ian Kelly <ian.g.kelly@gmail.com> - 2014-07-17 17:07 -0600
Re: NaN comparisons - Call For Anecdotes Chris Angelico <rosuav@gmail.com> - 2014-07-18 04:59 +1000
Re: NaN comparisons - Call For Anecdotes Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-07-18 17:57 +0000
Re: NaN comparisons - Call For Anecdotes Chris Angelico <rosuav@gmail.com> - 2014-07-19 05:49 +1000
csiph-web