Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Computation of median for discrete data: non-standard computation

Aperta
#87 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
35/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Ambito
data

Direzione di ricerca

Start by reading the math library's median implementation and its documentation, then run the reported example with (list 1 2 3 4). Check how quantile handles even-length discrete data as well. Done means the documented median behavior is consistent with the intended convention, with coverage for the even-length case.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Using (require math), we can compute (median < data), where data is a list of numbers.
When data length is even, then normally the median is computed by averaging the two central elements, after ordering.
The problem is that running the following code we obtain 2, but considering tipical references (e.g. wikipedia median) the value should be 2.5:
#lang racket
(require math)
(define data (list 1 2 3 4))
(median < data)

Could we maybe add some parameterization to the function median (and may be also to quantile) in order to compute the average of the central two elements, when the number of elements is even?

Thank you and congratulations for all your great work.

Lingua principale
Racket
Stelle
40
Fork
32
Merge medio
1g 9h
PR unite (30g)
3

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di racket/math

Tutte le issue di racket/math

Issue simili

Altre issue su Data Engineering

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.