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


Groups > comp.lang.python > #111216 > unrolled thread

Quick poll: gmean or geometric_mean

Started bySteven D'Aprano <steve@pearwood.info>
First post2016-07-09 15:26 +1000
Last post2016-07-10 09:04 -0600
Articles 20 on this page of 38 — 17 participants

Back to article view | Back to comp.lang.python


Contents

  Quick poll: gmean or geometric_mean Steven D'Aprano <steve@pearwood.info> - 2016-07-09 15:26 +1000
    Re: Quick poll: gmean or geometric_mean Jussi Piitulainen <jussi.piitulainen@helsinki.fi> - 2016-07-09 08:43 +0300
    Re: Quick poll: gmean or geometric_mean Random832 <random832@fastmail.com> - 2016-07-09 01:49 -0400
    Re: Quick poll: gmean or geometric_mean Ethan Furman <ethan@stoneleaf.us> - 2016-07-08 23:27 -0700
    Re: Quick poll: gmean or geometric_mean Peter Otten <__peter__@web.de> - 2016-07-09 11:04 +0200
      Re: Quick poll: gmean or geometric_mean Lawrence D’Oliveiro <lawrencedo99@gmail.com> - 2016-07-12 15:13 -0700
        Re: Quick poll: gmean or geometric_mean Chris Angelico <rosuav@gmail.com> - 2016-07-13 08:17 +1000
    Re: Quick poll: gmean or geometric_mean Stefan Behnel <stefan_ml@behnel.de> - 2016-07-09 12:23 +0200
    Re: Quick poll: gmean or geometric_mean Ethan Furman <ethan@stoneleaf.us> - 2016-07-09 06:51 -0700
    Re: Quick poll: gmean or geometric_mean Jason Friedman <jsf80238@gmail.com> - 2016-07-09 08:16 -0600
    Re: Quick poll: gmean or geometric_mean Michael Selik <michael.selik@gmail.com> - 2016-07-09 16:13 +0000
    Re: Quick poll: gmean or geometric_mean Robert Kern <robert.kern@gmail.com> - 2016-07-09 17:53 +0100
    Re: Quick poll: gmean or geometric_mean Michael Selik <michael.selik@gmail.com> - 2016-07-09 18:31 +0000
    Re: Quick poll: gmean or geometric_mean Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2016-07-09 17:39 -0400
    Re: Quick poll: gmean or geometric_mean Chris Angelico <rosuav@gmail.com> - 2016-07-10 07:45 +1000
    Re: Quick poll: gmean or geometric_mean Rustom Mody <rustompmody@gmail.com> - 2016-07-10 00:28 -0700
      Re: Quick poll: gmean or geometric_mean Steven D'Aprano <steve@pearwood.info> - 2016-07-10 18:51 +1000
        Re: Quick poll: gmean or geometric_mean Michael Selik <michael.selik@gmail.com> - 2016-07-10 09:24 +0000
          Re: Quick poll: gmean or geometric_mean Steven D'Aprano <steve@pearwood.info> - 2016-07-10 20:08 +1000
            Re: Quick poll: gmean or geometric_mean Chris Angelico <rosuav@gmail.com> - 2016-07-10 21:07 +1000
            Re: Quick poll: gmean or geometric_mean Rustom Mody <rustompmody@gmail.com> - 2016-07-10 07:29 -0700
              Re: Quick poll: gmean or geometric_mean Rustom Mody <rustompmody@gmail.com> - 2016-07-10 07:44 -0700
              Re: Quick poll: gmean or geometric_mean Ian Kelly <ian.g.kelly@gmail.com> - 2016-07-10 08:55 -0600
                Re: Quick poll: gmean or geometric_mean Marko Rauhamaa <marko@pacujo.net> - 2016-07-10 18:03 +0300
                  Re: Quick poll: gmean or geometric_mean Ian Kelly <ian.g.kelly@gmail.com> - 2016-07-10 11:15 -0600
                    Re: Quick poll: gmean or geometric_mean Lawrence D’Oliveiro <lawrencedo99@gmail.com> - 2016-07-12 15:17 -0700
                      Re: Quick poll: gmean or geometric_mean alister <alister.ware@ntlworld.com> - 2016-07-12 22:57 +0000
                        Re: Quick poll: gmean or geometric_mean Lawrence D’Oliveiro <lawrencedo99@gmail.com> - 2016-07-12 18:42 -0700
                          Re: Quick poll: gmean or geometric_mean Gene Heskett <gheskett@shentel.net> - 2016-07-12 21:58 -0400
                          Re: Quick poll: gmean or geometric_mean alister <alister.ware@ntlworld.com> - 2016-07-13 13:03 +0000
                        Re: Quick poll: gmean or geometric_mean Steven D'Aprano <steve@pearwood.info> - 2016-07-13 12:25 +1000
                  Re: Quick poll: gmean or geometric_mean Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2016-07-10 19:21 -0400
              Re: Quick poll: gmean or geometric_mean Random832 <random832@fastmail.com> - 2016-07-10 12:08 -0400
              Re: Quick poll: gmean or geometric_mean Lawrence D’Oliveiro <lawrencedo99@gmail.com> - 2016-07-12 15:19 -0700
            Re: Quick poll: gmean or geometric_mean Michael Selik <michael.selik@gmail.com> - 2016-07-10 15:43 +0000
    Re: Quick poll: gmean or geometric_mean Ian Kelly <ian.g.kelly@gmail.com> - 2016-07-10 01:28 -0600
      Re: Quick poll: gmean or geometric_mean Jussi Piitulainen <jussi.piitulainen@helsinki.fi> - 2016-07-10 11:01 +0300
        Re: Quick poll: gmean or geometric_mean Ian Kelly <ian.g.kelly@gmail.com> - 2016-07-10 09:04 -0600

Page 1 of 2  [1] 2  Next page →


#111216 — Quick poll: gmean or geometric_mean

FromSteven D'Aprano <steve@pearwood.info>
Date2016-07-09 15:26 +1000
SubjectQuick poll: gmean or geometric_mean
Message-ID<57808af6$0$1602$c3e8da3$5496439d@news.astraweb.com>
As requested in issue 27181 on the bug tracker, I'm adding functions to
calculate the harmonic and geometric means to the statistics module.

I'd like to get a quick show of hands regarding the names. Which do you
prefer?

hmean and gmean

harmonic_mean and geometric_mean


Remember that the arithmetic mean is just called "mean".

http://bugs.python.org/issue27181




-- 
Steven
“Cheer up,” they said, “things could be worse.” So I cheered up, and sure
enough, things got worse.

[toc] | [next] | [standalone]


#111217

FromJussi Piitulainen <jussi.piitulainen@helsinki.fi>
Date2016-07-09 08:43 +0300
Message-ID<lf5y45bwem8.fsf@ling.helsinki.fi>
In reply to#111216
Steven D'Aprano writes:

> As requested in issue 27181 on the bug tracker, I'm adding functions
> to calculate the harmonic and geometric means to the statistics
> module.
>
> I'd like to get a quick show of hands regarding the names. Which do
> you prefer?
>
> hmean and gmean
>
> harmonic_mean and geometric_mean
>
>
> Remember that the arithmetic mean is just called "mean".
>
> http://bugs.python.org/issue27181

First reaction: hmean and gmean.

After reading the issue: hmean and gmean.

After a brief glance at the statistics module: hmean and gmean.

Or also change pstdev and pvariance to population_stdev and
population_variance for consistency. Still: hmean and gmean.

[toc] | [prev] | [next] | [standalone]


#111218

FromRandom832 <random832@fastmail.com>
Date2016-07-09 01:49 -0400
Message-ID<mailman.146.1468043390.2295.python-list@python.org>
In reply to#111216
On Sat, Jul 9, 2016, at 01:26, Steven D'Aprano wrote:
> hmean and gmean
> 
> harmonic_mean and geometric_mean

The latter, definitely.

> Remember that the arithmetic mean is just called "mean".

so? (also maybe it shouldn't be?)

[toc] | [prev] | [next] | [standalone]


#111219

FromEthan Furman <ethan@stoneleaf.us>
Date2016-07-08 23:27 -0700
Message-ID<mailman.147.1468045617.2295.python-list@python.org>
In reply to#111216
On 07/08/2016 10:49 PM, Random832 wrote:
> On Sat, Jul 9, 2016, at 01:26, Steven D'Aprano wrote:

>> hmean and gmean
>>
>> harmonic_mean and geometric_mean
>
> The latter, definitely.

My preference is also for the latter.  However, if the rest of the 
module is filled with abbreviated names you may as well be consistent 
with them.

--
~Ethan~

[toc] | [prev] | [next] | [standalone]


#111220

FromPeter Otten <__peter__@web.de>
Date2016-07-09 11:04 +0200
Message-ID<mailman.148.1468055072.2295.python-list@python.org>
In reply to#111216
Steven D'Aprano wrote:

> As requested in issue 27181 on the bug tracker, I'm adding functions to
> calculate the harmonic and geometric means to the statistics module.
> 
> I'd like to get a quick show of hands regarding the names. Which do you
> prefer?
> 
> hmean and gmean
> 
> harmonic_mean and geometric_mean

The long names. Life's too short for abbreviations.

> Remember that the arithmetic mean is just called "mean".

I think it's a safe bet that a user asking for the unqualified mean wants 
just that.

> http://bugs.python.org/issue27181

[toc] | [prev] | [next] | [standalone]


#111355

FromLawrence D’Oliveiro <lawrencedo99@gmail.com>
Date2016-07-12 15:13 -0700
Message-ID<9c384acb-d5ce-4ba8-852e-3798aa51ca46@googlegroups.com>
In reply to#111220
On Saturday, July 9, 2016 at 9:05:18 PM UTC+12, Peter Otten wrote:

> Life's too short for abbreviations.

Why is there no abbreviation for “abbreviation”?

Let me propose “brev”. Nice and ... um ... abbreviated.

[toc] | [prev] | [next] | [standalone]


#111356

FromChris Angelico <rosuav@gmail.com>
Date2016-07-13 08:17 +1000
Message-ID<mailman.22.1468361872.21009.python-list@python.org>
In reply to#111355
On Wed, Jul 13, 2016 at 8:13 AM, Lawrence D’Oliveiro
<lawrencedo99@gmail.com> wrote:
> On Saturday, July 9, 2016 at 9:05:18 PM UTC+12, Peter Otten wrote:
>
>> Life's too short for abbreviations.
>
> Why is there no abbreviation for “abbreviation”?
>
> Let me propose “brev”. Nice and ... um ... abbreviated.

abbr?

ChrisA

[toc] | [prev] | [next] | [standalone]


#111221

FromStefan Behnel <stefan_ml@behnel.de>
Date2016-07-09 12:23 +0200
Message-ID<mailman.149.1468059817.2295.python-list@python.org>
In reply to#111216
Ethan Furman schrieb am 09.07.2016 um 08:27:
> On 07/08/2016 10:49 PM, Random832 wrote:
>> On Sat, Jul 9, 2016, at 01:26, Steven D'Aprano wrote:
> 
>>> hmean and gmean
>>>
>>> harmonic_mean and geometric_mean
>>
>> The latter, definitely.
> 
> My preference is also for the latter.  However, if the rest of the module
> is filled with abbreviated names you may as well be consistent with them.

+1 for consistency, but I'm just fine with the short names. It's in the
statistics module after all, so the context is very narrow and clear and
people who don't know which to use or what the one does that they find in a
given piece of code will have to read the docs and maybe fresh up their
rusty math memory anyway. Longer names don't help much with that.

If further clarity is needed in a given code context that uses a direct
name import, renaming the function at the same time is easy enough. I often
do that with "os.path.join", for example, which turns into "join_path" on
import. Same problem, easy solution.

Stefan

[toc] | [prev] | [next] | [standalone]


#111222

FromEthan Furman <ethan@stoneleaf.us>
Date2016-07-09 06:51 -0700
Message-ID<mailman.150.1468072306.2295.python-list@python.org>
In reply to#111216
On 07/09/2016 03:23 AM, Stefan Behnel wrote:
> Ethan Furman schrieb am 09.07.2016 um 08:27:
>> On 07/08/2016 10:49 PM, Random832 wrote:
>>> On Sat, Jul 9, 2016, at 01:26, Steven D'Aprano wrote:
>>
>>>> hmean and gmean
>>>>
>>>> harmonic_mean and geometric_mean
>>>
>>> The latter, definitely.
>>
>> My preference is also for the latter.  However, if the rest of the module
>> is filled with abbreviated names you may as well be consistent with them.
>
> +1 for consistency, but I'm just fine with the short names. It's in the
> statistics module after all, so the context is very narrow and clear and
> people who don't know which to use or what the one does that they find in a
> given piece of code will have to read the docs and maybe fresh up their
> rusty math memory anyway. Longer names don't help much with that.
>
> If further clarity is needed in a given code context that uses a direct
> name import, renaming the function at the same time is easy enough. I often
> do that with "os.path.join", for example, which turns into "join_path" on
> import. Same problem, easy solution.

+1

I would definitely need to read the docs, whatever the name.  ;)

--
~Ethan~

[toc] | [prev] | [next] | [standalone]


#111224

FromJason Friedman <jsf80238@gmail.com>
Date2016-07-09 08:16 -0600
Message-ID<mailman.151.1468073782.2295.python-list@python.org>
In reply to#111216
>
> +1 for consistency, but I'm just fine with the short names. It's in the
> statistics module after all, so the context is very narrow and clear and
> people who don't know which to use or what the one does that they find in a
> given piece of code will have to read the docs and maybe fresh up their
> rusty math memory anyway. Longer names don't help much with that.
>
> If further clarity is needed in a given code context that uses a direct
> name import, renaming the function at the same time is easy enough. I often
> do that with "os.path.join", for example, which turns into "join_path" on
> import. Same problem, easy solution.


+1

[toc] | [prev] | [next] | [standalone]


#111225

FromMichael Selik <michael.selik@gmail.com>
Date2016-07-09 16:13 +0000
Message-ID<mailman.152.1468080817.2295.python-list@python.org>
In reply to#111216
On Sat, Jul 9, 2016 at 10:17 AM Jason Friedman <jsf80238@gmail.com> wrote:

> > +1 for consistency
>

What do other languages use?

Even though I generally prefer complete words instead of abbreviations, if
an abbreviation is a strong standard across many statistics modules (like
"stdev" instead of "standard_deviation"), then it's better to stay
consistent with that standard.

[toc] | [prev] | [next] | [standalone]


#111226

FromRobert Kern <robert.kern@gmail.com>
Date2016-07-09 17:53 +0100
Message-ID<mailman.153.1468083241.2295.python-list@python.org>
In reply to#111216
On 2016-07-09 17:13, Michael Selik wrote:
> On Sat, Jul 9, 2016 at 10:17 AM Jason Friedman <jsf80238@gmail.com> wrote:
>
>>> +1 for consistency
>
> What do other languages use?

R, the most likely candidate, doesn't have them built-in.

scipy.stats uses gmean() and hmean()

-- 
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless enigma
  that is made terrible by our own mad attempt to interpret it as though it had
  an underlying truth."
   -- Umberto Eco

[toc] | [prev] | [next] | [standalone]


#111227

FromMichael Selik <michael.selik@gmail.com>
Date2016-07-09 18:31 +0000
Message-ID<mailman.154.1468089133.2295.python-list@python.org>
In reply to#111216
On Sat, Jul 9, 2016, 12:57 PM Robert Kern <robert.kern@gmail.com> wrote:

> On 2016-07-09 17:13, Michael Selik wrote:
> > On Sat, Jul 9, 2016 at 10:17 AM Jason Friedman <jsf80238@gmail.com>
> wrote:
> >
> >>> +1 for consistency
> >
> > What do other languages use?
>
> R, the most likely candidate, doesn't have them built-in.
>
> scipy.stats uses gmean() and hmean()
>

SciPy also uses other obscure abbreviations. My least favorite is "eye".

My first thought at reading "hmean" might be horizontal mean, especially if
there were a vmean.

>

[toc] | [prev] | [next] | [standalone]


#111230

FromDennis Lee Bieber <wlfraed@ix.netcom.com>
Date2016-07-09 17:39 -0400
Message-ID<mailman.156.1468100398.2295.python-list@python.org>
In reply to#111216
On Sat, 09 Jul 2016 18:31:54 +0000, Michael Selik <michael.selik@gmail.com>
declaimed the following:

>On Sat, Jul 9, 2016, 12:57 PM Robert Kern <robert.kern@gmail.com> wrote:
>
>> On 2016-07-09 17:13, Michael Selik wrote:
>> > On Sat, Jul 9, 2016 at 10:17 AM Jason Friedman <jsf80238@gmail.com>
>> wrote:
>> >
>> >>> +1 for consistency
>> >
>> > What do other languages use?
>>
>> R, the most likely candidate, doesn't have them built-in.
>>
>> scipy.stats uses gmean() and hmean()
>>
>
>SciPy also uses other obscure abbreviations. My least favorite is "eye".

	At least it isn't the PowerPC opcode EIEIO

https://www.ibm.com/support/knowledgecenter/ssw_aix_61/com.ibm.aix.alangref/idalangref_eieio_instrs.htm
-- 
	Wulfraed                 Dennis Lee Bieber         AF6VN
    wlfraed@ix.netcom.com    HTTP://wlfraed.home.netcom.com/

[toc] | [prev] | [next] | [standalone]


#111231

FromChris Angelico <rosuav@gmail.com>
Date2016-07-10 07:45 +1000
Message-ID<mailman.157.1468100715.2295.python-list@python.org>
In reply to#111216
On Sat, Jul 9, 2016 at 3:26 PM, Steven D'Aprano <steve@pearwood.info> wrote:
> I'd like to get a quick show of hands regarding the names. Which do you
> prefer?
>
> hmean and gmean
>
> harmonic_mean and geometric_mean

I'd prefer the shorter names.

ChrisA

[toc] | [prev] | [next] | [standalone]


#111238

FromRustom Mody <rustompmody@gmail.com>
Date2016-07-10 00:28 -0700
Message-ID<bc4c3c65-97ba-4c73-86d8-a013ff76f030@googlegroups.com>
In reply to#111216
On Saturday, July 9, 2016 at 10:56:27 AM UTC+5:30, Steven D'Aprano wrote:
> As requested in issue 27181 on the bug tracker, I'm adding functions to
> calculate the harmonic and geometric means to the statistics module.
> 
> I'd like to get a quick show of hands regarding the names. Which do you
> prefer?
> 
> hmean and gmean
> 
> harmonic_mean and geometric_mean
> 
> 
> Remember that the arithmetic mean is just called "mean".
> 
> http://bugs.python.org/issue27181

From fuzzy memory of sitting in statistics classes decades ago 
filled with μ-σ etc I'd suggest μ gμ hμ 

And before I duck and run let me just tell my dear Chris I was only ½-joking

[toc] | [prev] | [next] | [standalone]


#111241

FromSteven D'Aprano <steve@pearwood.info>
Date2016-07-10 18:51 +1000
Message-ID<57820c7a$0$1617$c3e8da3$5496439d@news.astraweb.com>
In reply to#111238
On Sun, 10 Jul 2016 05:28 pm, Rustom Mody wrote:

> From fuzzy memory of sitting in statistics classes decades ago
> filled with μ-σ etc I'd suggest μ gμ hμ

In all the stats books and references I've seen, μ is always the population
mean (implicitly the arithmetic mean). When discussing the different kinds
of mean, A, G and H are used for arithmetic, geometric and harmonic means.
(Other means are rarely discussed.)

I don't think I've ever seen gµ or hµ. They're sort of backwards... I'd
expect µ subscript-g or subscript-h, not the other way.



-- 
Steven
“Cheer up,” they said, “things could be worse.” So I cheered up, and sure
enough, things got worse.

[toc] | [prev] | [next] | [standalone]


#111242

FromMichael Selik <michael.selik@gmail.com>
Date2016-07-10 09:24 +0000
Message-ID<mailman.163.1468142670.2295.python-list@python.org>
In reply to#111241
On Sun, Jul 10, 2016, 4:56 AM Steven D'Aprano <steve@pearwood.info> wrote:

> On Sun, 10 Jul 2016 05:28 pm, Rustom Mody wrote:
>
> > From fuzzy memory of sitting in statistics classes decades ago
> > filled with μ-σ etc I'd suggest μ gμ hμ
>
> In all the stats books and references I've seen, μ is always the population
> mean (implicitly the arithmetic mean). When discussing the different kinds
> of mean, A, G and H are used for arithmetic, geometric and harmonic means.
> (Other means are rarely discussed.)
>
> I don't think I've ever seen gµ or hµ. They're sort of backwards... I'd
> expect µ subscript-g or subscript-h, not the other way.
>

I'm glad you brought up textbooks as it reminded me to say that most
scientific software is still struggling to shake off the legacy of
abbreviation.

Now even the basic IPython shell has autocomplete :-)

>

[toc] | [prev] | [next] | [standalone]


#111243

FromSteven D'Aprano <steve@pearwood.info>
Date2016-07-10 20:08 +1000
Message-ID<57821eaa$0$1584$c3e8da3$5496439d@news.astraweb.com>
In reply to#111242
On Sun, 10 Jul 2016 07:24 pm, Michael Selik wrote:

> On Sun, Jul 10, 2016, 4:56 AM Steven D'Aprano <steve@pearwood.info> wrote:
> 
>> On Sun, 10 Jul 2016 05:28 pm, Rustom Mody wrote:
>>
>> > From fuzzy memory of sitting in statistics classes decades ago
>> > filled with μ-σ etc I'd suggest μ gμ hμ
>>
>> In all the stats books and references I've seen, μ is always the
>> population mean (implicitly the arithmetic mean). When discussing the
>> different kinds of mean, A, G and H are used for arithmetic, geometric
>> and harmonic means. (Other means are rarely discussed.)
>>
>> I don't think I've ever seen gµ or hµ. They're sort of backwards... I'd
>> expect µ subscript-g or subscript-h, not the other way.
>>
> 
> I'm glad you brought up textbooks as it reminded me to say that most
> scientific software is still struggling to shake off the legacy of
> abbreviation.
> 
> Now even the basic IPython shell has autocomplete :-)

Not all shells or editors are IPython, and not all abbreviations are bad.
Would you rather print, or
write_values_as_strings_to_the_predefined_standard_output_file?

:-)


-- 
Steven
“Cheer up,” they said, “things could be worse.” So I cheered up, and sure
enough, things got worse.

[toc] | [prev] | [next] | [standalone]


#111244

FromChris Angelico <rosuav@gmail.com>
Date2016-07-10 21:07 +1000
Message-ID<mailman.164.1468148844.2295.python-list@python.org>
In reply to#111243
On Sun, Jul 10, 2016 at 8:08 PM, Steven D'Aprano <steve@pearwood.info> wrote:
>> Now even the basic IPython shell has autocomplete :-)
>
> Not all shells or editors are IPython, and not all abbreviations are bad.
> Would you rather print, or
> write_values_as_strings_to_the_predefined_standard_output_file?

Also: Interesting that the IPython shell is "basic". I thought the
basic Python shell was the one you get when you type "python" with no
args. Idle or IPython or anything else is a layer on top of that.

ChrisA

[toc] | [prev] | [next] | [standalone]


Page 1 of 2  [1] 2  Next page →

Back to top | Article view | comp.lang.python


csiph-web