Raymond Hettinger <raymond.hettin...@gmail.com> added the comment:

> I would like to hear why you removed the P/E example
> instead of just adding additional examples.

I tried out the existing P/E example in my Python courses and found that it had 
very little explanatory power — in general, non-finance people know less about 
P/E ratios than they know about the harmonic mean :-)  

For people with a finance background who do already understand P/E ratios, the 
example is weak.  The current example only works mathematically if the 
portfolios are exactly the same market value at the time the ratios are 
combined — this never happens.  Also P/E ratios in real portfolios include zero 
and negative values — that won't work with our harmonic mean.  Also, combining 
P/Es for non-homogenous securities is a bit of dark art.  Given a utility 
stock, a healthcare stock, and a tech stock, the aggregate P/E is rarely 
comparable to anything else.

All that said, I would be happy to add the example back if you think it is 
necessary.  It's your module and it's important that you're happy with it :-)

> I think that it's useful to have an example that shows that 
> harmonic mean is not *just* for speed-related problems.

I considered using a resistors in parallel example, but that is somewhat 
specialized and isn't directly applicable because we normally don't want a mean 
at all, we just want the equivalent resistance.

I also thought about adding something like: "The harmonic mean is the smaller 
of the three Pythagorean means and tends to emphasize the impact of small 
outliers while minimizing the impact of large outliers."  But while this is 
true, I've never seen a data scientist switch from an arithmetic mean to a 
harmonic mean to achieve this effect.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue38308>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to