Re: lambda with floats



On Apr 9, 1:22 pm, monkeys paw <mon...@xxxxxxxxxxxx> wrote:
On 4/9/2010 3:43 AM, Bas wrote:

On Apr 7, 6:15 am, Patrick Maupin<pmau...@xxxxxxxxx>  wrote:
I should stop making a habit of responding to myself, BUT.  This isn't
quite an acre in square feet.  I just saw the 43xxx and assumed it
was, and then realized it couldn't be, because it wasn't divisible by
10.  (I used to measure land with my grandfather with a 66 foot long
chain, and learned at an early age that an acre was 1 chain by 10
chains, or 66 * 66 * 10 = 43560 sqft.)
That's an exact number, and 208 is a poor approximation of its square
root.

There is no need to remember those numbers for the imperially
challenged people:

In [1]: import scipy.constants as c

scipy.constants ??

doesn't work for me.



In [2]: def acre2sqft(a):
    ...:     return a * c.acre / (c.foot * c.foot)
    ...:

In [3]: acre2sqft(1)
Out[3]: 43560.0

Cheers,
Bas



Basically, he's saying that, instead of remembering the very simple
"66" and "10" values, you can download and install a multi-megabyte
gzipped tar file for the scipy project. ;-)

(Of course, you get a few nice functions thrown in for free along with
your constants, but downloading scipy for its constants is like
choosing a sports car for its cupholders.)
.



Relevant Pages

  • Re: lambda with floats
    ... quite an acre in square feet. ... chain, and learned at an early age that an acre was 1 chain by 10 ... Appreciate the help, i just looked up the SciPY Project download, ...
    (comp.lang.python)
  • Re: lambda with floats
    ... how do i convert this to float? ... I'm not sure exactly what you mean by "acre meter" though; ... returns the number of square feet in 'n' acres. ... chain, and learned at an early age that an acre was 1 chain by 10 ...
    (comp.lang.python)
  • Re: lambda with floats
    ... does not have a name) from an outer function. ... I'm not sure exactly what you mean by "acre meter" though; ... returns the number of square feet in 'n' acres. ... chain, and learned at an early age that an acre was 1 chain by 10 ...
    (comp.lang.python)
  • Re: lambda with floats
    ... does not have a name) from an outer function. ... I'm not sure exactly what you mean by "acre meter" though; ... returns the number of square feet in 'n' acres. ... chain, and learned at an early age that an acre was 1 chain by 10 ...
    (comp.lang.python)
  • Re: lambda with floats
    ... On 4/9/2010 3:43 AM, Bas wrote: ... quite an acre in square feet. ... chain, and learned at an early age that an acre was 1 chain by 10 ...
    (comp.lang.python)