Message355692
Thank you for your comments, but accepting non-floats like Decimal and
Fraction (and int, of course!) is a hard requirement for the statistics
module. fmean will naturally convert any data to float for speed, but
the other means will attempt to keep the original data type if possible,
so that the mean() of Decimals will be a Decimal, the mean of Fractions
will be a Fraction, etc.
The median_low and median_high functions don't require numbers at all,
the data points just need to be ordinal data and support sorting. The
mode function doesn't even require ordinal data, it can work with
nominal data. That is part of the definition of median and mode, and
will not change.
http://intellspot.com/nominal-vs-ordinal-data/
So long as Python support IEEE-754 floating point arithmetic, which is
the most common standard for floating point, there will be NANs and
INFs. We should not reject them unnecessarily. You can always pre-filter
your data before passing it the statistics module.
Why do you object to float INF? |
|
Date |
User |
Action |
Args |
2019-10-30 05:21:25 | steven.daprano | set | recipients:
+ steven.daprano, tim.peters, rhettinger, mark.dickinson, taleinat, gaoxinge, WarrenWeckesser |
2019-10-30 05:21:25 | steven.daprano | link | issue38382 messages |
2019-10-30 05:21:25 | steven.daprano | create | |
|