Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

197
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!