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

Order of x in weighted_median matters but is not documented #16

Open
Lyalpha opened this issue Feb 3, 2022 · 0 comments
Open

Order of x in weighted_median matters but is not documented #16

Lyalpha opened this issue Feb 3, 2022 · 0 comments

Comments

@Lyalpha
Copy link

Lyalpha commented Feb 3, 2022

I might expect

assert(robustats.weighted_median([1,2,3], [1,2,3]) == robustats.weighted_median([3,2,1], [3,2,1]))

to not raise an error, unless I am really missing something? It seems somewhere that there is dependency on the ordering of x but I can't work out any consistency, e.g.

assert(robustats.weighted_median([3,2,1], [3,2,1]) == robustats.weighted_median([3,1,2], [3,1,2]))

is fine (but note both incorrect from the [1,2,3] ordering.

Is there an implicit assumption that x is passed in ascending order? In this case it needs to be documented (or sorted prior to or within the call to the c-code perhaps)

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

No branches or pull requests

1 participant