Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

199
Visualizações
how to have custom quartiles and median for boxplot plotlyjs

I have dynamic data. Based on length of data i.e even or odd. Based on that i need to calculate custom quartiles and median and pass in theplotly js boxplot.

here is what quartile generally does,

Excel QUARTILE.EXC() Function / Wikipedia method 1 Use the median to divide the ordered data set into two halves. o If there is an odd number of data points in the original ordered data set, do not include the median (the central value in the ordered list) in either half. o If there is an even number of data points in the original ordered data set, split this data set exactly in half. The lower quartile value is the median of the lower half of the data. The upper quartile value is the median of the upper half of the data.

Excel QUARTILE.INC() Function / Wikipedia method 2 Use the median to divide the ordered data set into two halves. o If there are an odd number of data points in the original ordered data set, include the median (the central value in the ordered list) in both halves. o If there are an even number of data points in the original ordered data set, split this data set exactly in half. The lower quartile value is the median of the lower half of the data. The upper quartile value is the median of the upper half of the data.

I am thinking this way,

Exclusive method:

def get_Q1_exclusive(data):
    N = data.length
    return 

Inclusive method:

def get_Q1_inclusive(data):
    N = data.length
    return 

After calculating manual quartiles, need to pass like this,

var data = [
  {
    q1: [3, 1],
    median: [4, 2],
    q3: [5, 3],
    mean: [4.5, 2.5],
    sd: [1, 1],
    lowerfence: [0.5, 0.5],
    upperfence: [9, 8],
    type: 'box'
  }
];

Plotly.newPlot('myDiv', data);

How to calculate inclusive/exclusive quartiles, median etc.?

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda