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


Groups > comp.lang.python > #20493

format a measurement result and its error in "scientific" way

Path csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!aioe.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed5.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path <fetchinson@googlemail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.010
X-Spam-Evidence '*H*': 0.98; '*S*': 0.00; 'folks,': 0.09; 'received:209.85.216.53': 0.09; 'received:mail- qw0-f53.google.com': 0.09; 'subject:error': 0.09; 'float': 0.13; '(say': 0.16; 'from:addr:fetchinson': 0.16; 'from:name:daniel fetchinson': 0.16; 'function?': 0.16; 'parentheses': 0.16; 'psss,': 0.16; 'simplest': 0.16; 'subject:result': 0.16; 'url:putitdown': 0.16; 'arguments': 0.18; 'cheers,': 0.20; 'tells': 0.21; 'string': 0.24; 'function': 0.27; 'subject:" ': 0.28; 'message-id:@mail.gmail.com': 0.29; '(and': 0.30; 'subject:format': 0.30; "didn't": 0.30; 'error': 0.30; 'from:addr:googlemail.com': 0.31; "i've": 0.32; 'times.': 0.34; 'daniel': 0.34; 'done': 0.34; 'anything': 0.34; 'round': 0.34; 'to:addr:python-list': 0.35; 'something': 0.35; 'things': 0.35; 'digit': 0.37; 'but': 0.37; 'received:google.com': 0.37; 'received:209.85': 0.38; 'received:209': 0.39; 'put': 0.40; 'to:addr:python.org': 0.40; 'simple': 0.61; 'vary': 0.64; 'so:': 0.84; 'subject:its': 0.84; 'expresses': 0.91
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; bh=kOwSA0g2jfHE91E7FY7cuV4MtoLDNH59CThb2Jj0hYY=; b=HVUHXGgInITF6FTF/DATRjshSioAwLaIZnhfTt27RTC5k5053LCcrAxJSLzY8Jgni+ plM8qge52g6uWEartjE14bli6RZKRrilfK5PaY9H7oCnW/kijQSLUUZ1/RTMHvzMUqaw qCX3eZGkfnM/qCegjHjieY0qPdSd+ZE8r12es=
MIME-Version 1.0
Date Thu, 16 Feb 2012 01:18:07 +0100
Subject format a measurement result and its error in "scientific" way
From Daniel Fetchinson <fetchinson@googlemail.com>
To Python <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.5869.1329351490.27778.python-list@python.org> (permalink)
Lines 19
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1329351490 news.xs4all.nl 6959 [2001:888:2000:d::a6]:53347
X-Complaints-To abuse@xs4all.nl
Xref x330-a1.tempe.blueboxinc.net comp.lang.python:20493

Show key headers only | View raw


Hi folks, often times in science one expresses a value (say
1.03789291) and its error (say 0.00089) in a short way by parentheses
like so: 1.0379(9)

One can vary things a bit, but let's take the simplest case when we
only keep 1 digit of the error (and round it of course) and round the
value correspondingly. I've been searching around for a simple
function that would take 2 float arguments and would return a string
but didn't find anything although something tells me it's been done a
gazillion times.

What would be the simplest such function?

Cheers,
Daniel


-- 
Psss, psss, put it down! - http://www.cafepress.com/putitdown

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


Thread

format a measurement result and its error in "scientific" way Daniel Fetchinson <fetchinson@googlemail.com> - 2012-02-16 01:18 +0100
  Re: format a measurement result and its error in "scientific" way jmfauth <wxjmfauth@gmail.com> - 2012-02-17 01:17 -0800
    Re: format a measurement result and its error in "scientific" way Daniel Fetchinson <fetchinson@googlemail.com> - 2012-02-17 11:03 +0100
      Re: format a measurement result and its error in "scientific" way jmfauth <wxjmfauth@gmail.com> - 2012-02-17 04:13 -0800
  Re: format a measurement result and its error in "scientific" way Ulrich Eckhardt <ulrich.eckhardt@dominolaser.com> - 2012-02-17 12:16 +0100

csiph-web