{"id":18301901,"url":"https://github.com/fegoa89/average","last_synced_at":"2025-07-31T05:08:26.630Z","repository":{"id":27892649,"uuid":"31384181","full_name":"fegoa89/Average","owner":"fegoa89","description":"Find the arithmethic mean/mode/median of an array of numbers .","archived":false,"fork":false,"pushed_at":"2018-10-08T07:57:48.000Z","size":33,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-27T10:43:44.979Z","etag":null,"topics":["average","ruby"],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fegoa89.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-02-26T19:16:53.000Z","updated_at":"2022-03-21T01:43:29.000Z","dependencies_parsed_at":"2022-08-02T16:45:25.837Z","dependency_job_id":null,"html_url":"https://github.com/fegoa89/Average","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/fegoa89/Average","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fegoa89%2FAverage","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fegoa89%2FAverage/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fegoa89%2FAverage/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fegoa89%2FAverage/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fegoa89","download_url":"https://codeload.github.com/fegoa89/Average/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fegoa89%2FAverage/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267988975,"owners_count":24177018,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-31T02:00:08.723Z","response_time":66,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["average","ruby"],"created_at":"2024-11-05T15:17:21.094Z","updated_at":"2025-07-31T05:08:26.605Z","avatar_url":"https://github.com/fegoa89.png","language":"Ruby","readme":"[![Build Status](https://semaphoreci.com/api/v1/projects/fd96a25e-c843-44ff-8c43-1da486ca03a6/425376/badge.svg)](https://semaphoreci.com/fegoa89/average)      \n\n# Average\n\nSimple gem to calculate mean, median and mode from an array.\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n    gem 'average'\n\nAnd then execute:\n\n    $ bundle\n\nOr install it yourself as:\n\n    $ gem install average\n\n## Usage\n\nGet Median\n\n    $ [3, 4, 5, 2, 3, 1].mean\n    $ 3.0\n\nGet Mode\n\n    $ [2,4,6,14,21,24,229,24,24,39].mode\n    $ 24\n\nIt gives back an array due that could be possible to have more than one mode in a array\n\n    $ [1, 2, 2, 2, 3, 3, 7, 7, 7, 9].mode\n    $ [2, 7]\n\nBut if you want to have only a unique mode, you can use 'unique_mode' method (Only for Ruby versions bigger than 1.8.7 -\u003e http://apidock.com/ruby/v1_8_7_72/Enumerable/max_by).\n\n    $ [1, 2, 2, 2, 3, 3, 7, 7, 7, 9].unique_mode\n    $ 2\n\nGet Median\n\n    $ [3,4,5].median\n    $ 4\n    \nAll methods described aboved can handle an array of integers, floats, strings or a mixed array with all of them\n    \n    $ [3, \"4\", 5, 2.0, 3, \"1.0\"].mean\n    $ 3.0\n\n## Contributing\n\n1. Fork it\n2. Create your feature branch (`git checkout -b my-new-feature`)\n3. Commit your changes (`git commit -am 'Add some feature'`)\n4. Push to the branch (`git push origin my-new-feature`)\n5. Create new Pull Request\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffegoa89%2Faverage","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffegoa89%2Faverage","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffegoa89%2Faverage/lists"}