Skip to content

Median aggregation is not computing the right value #2588

Description

@sgratzl

Describe the bug (required)

looking at the aggregation code I notice that the median aggregation function is not computing the correct value:

https://github.com/tannerlinsley/react-table/blob/aa2835766a7a34f70cd6b579628e4f7e820970ab/src/aggregations.js#L52-L68

see also https://en.wikipedia.org/wiki/Median

Provide an example via Codesandbox! (required)
https://codesandbox.io/s/angry-lehmann-kb9vx?file=/src/App.js

Steps To Reproduce (required)
Steps to reproduce the behavior:

  1. Go to 'https://codesandbox.io/s/angry-lehmann-kb9vx?file=/src/App.js
  2. Click on "group by status"
  3. Compare median values of different groups

Expected behavior (Recommended)
I would expect that these two median values are equal

Activity

  1. tannerlinsley commented on Aug 3, 2020

    @tannerlinsley
    Member

    My goodness you're right!

  2. tannerlinsley commented on Aug 3, 2020

    @tannerlinsley
    Member

    🎉 This issue has been resolved in version 7.4.2 🎉

    The release is available on:

    Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions