syalanskiy/simple-stat 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

syalanskiy/simple-stat

最新稳定版本:v1.0.0

Composer 安装命令:

composer require syalanskiy/simple-stat

包简介

Simple Math Stat Library

README 文档

README

This is a PHP class that performs various calculations on numeric arrays.

Installation

The package can be installed via Composer by running the following command:

composer require syalanskiy/simple-stat

Usage

First, include the vendor/autoload.php file:

require_once 'vendor/autoload.php';

Then, create an instance of the Stat class:

$data = [1, 7.7, 2, 3.3, 7.7, 5.67, 2, 1.1, 7.7, 9];
$stat = new \Yalanskiy\SimpleStat\Stat($data);

To perform calculation, call the appropriate method:

$stat->count();
$stat->summ();
$stat->arithmeticMean();
$stat->geometricMean();
$stat->median();
$stat->mode();

Example

$data = [1, 7.7, 2, 3.3, 7.7, 5.67, 2, 1.1, 7.7, 9];
$stat = new \Yalanskiy\SimpleStat\Stat($data);

echo $stat->count();
echo PHP_EOL;

echo $stat->summ();
echo PHP_EOL;

echo $stat->arithmeticMean();
echo PHP_EOL;

echo $stat->geometricMean();
echo PHP_EOL;

echo $stat->median();
echo PHP_EOL;

echo $stat->mode();
echo PHP_EOL;

Contribution

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

License

This project is licensed under the MIT License. See the LICENSE file for details.

统计信息

  • 总下载量: 3
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-11-20