Hi-Folks / statistics

PHP package that provides functions for calculating mathematical statistics of numeric data.
https://packagist.org/packages/hi-folks/statistics
MIT License
363 stars 24 forks source link

Fixed median() to handle unsorted data. Minor text changes for consistency #66

Closed keatis closed 10 months ago

keatis commented 10 months ago

Hi. Turned out that median() did not sort an array, thus giving wrong result on unsorted data. So, this PR is to fix this - median() will now sort data on self behalf, like quantiles() do.

Tests are included (I also made some text changes to look more consistent over that test file). Thanks.

roberto-butti commented 10 months ago

thank you for your feedback, and your PR. I really appreciated! I will create a new release on 26th Dec.

roberto-butti commented 10 months ago

Ehi @keatis ,thank you for your feedback, your effort and your proactivity in creating this PR. I added some additional tests for the median() function and I merged it into the v1.0.0. 🎉

keatis commented 10 months ago

Thank you too, @roberto-butti. Glad to help! :)