📜  laravel 集合中位数 - PHP 代码示例

📅  最后修改于: 2022-03-11 14:54:45.046000             🧑  作者: Mango

代码示例1
$median = collect([['foo' => 10], ['foo' => 10], ['foo' => 20], ['foo' => 40]])->median('foo');

// 15

$median = collect([1, 1, 2, 4])->median();

// 1.5