Message232593
Even though I agree with closing this issue, there is some support for ignoring certain "missing values" when calculating min() and max(). The draft 2008 revision of IEEE-754 includes two functions maxNum and minNum which silently skip over NANs:
https://en.wikipedia.org/wiki/IEEE_754_revision#min_and_max
The R language also supports max and min skipping over missing values:
https://stat.ethz.ch/R-manual/R-devel/library/base/html/Extremes.html
The problem is that there are so many different things which somebody might want to do, it is hard to tell which (if any) the built-ins should support:
- silently skip over None
- or NANs
- or treat some other, user-specified, value as "missing"
- treat None as the smallest (or largest) value
- treat the presence of None as an error
- etc.
I think that min() and max() should continue to be relatively simple-minded and let users write their own more complex versions if needed, e.g. by calling min(filter(condition, values)). |
|
Date |
User |
Action |
Args |
2014-12-13 04:06:37 | steven.daprano | set | recipients:
+ steven.daprano, r.david.murray, simeon.visser, Brian.Mearns |
2014-12-13 04:06:37 | steven.daprano | set | messageid: <1418443597.85.0.717851476877.issue22979@psf.upfronthosting.co.za> |
2014-12-13 04:06:37 | steven.daprano | link | issue22979 messages |
2014-12-13 04:06:37 | steven.daprano | create | |
|