Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Math.gini_coefficient(array) #302

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

TheStranjer
Copy link

Currently if you try this code:

require 'facets/math/gini_coefficient'
a = (1..10).to_a
Math::gini_coefficient(a)

It will throw this error:

lib/standard/facets/math/gini_coefficient.rb:16:in `gini_coefficient': undefined local variable or method `size' for Math:Module (NameError)

At first I thought I might be using it wrong, but all the other array-based methods in facets/math seem to refer to the array directly, so this should too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant