How can I print the outliers of a Boxplot in Python?

mathsqt

I want to print the outliers (green points) of my boxplot but I don't know how: boxplot

This is my code:

flierprops = dict(marker='o', markerfacecolor='green', markersize=2,
                  linestyle='none')

plt.boxplot(derivation, vert=False, flierprops=flierprops)

Thanks for helping me!

S3DEV

IIUC:
There are (n) points beyond the whiskers (upper and lower) and you wish to print (display) the values of these points, from your dataset.

Background:

Generally, outliers can be visualised as the values outside the upper and lower whiskers of a box plot. The upper and lower whiskers can be defined in a number of ways.

One method is:

Lower: Q1 - k * IQR

Upper: Q3 + k * IQR

where k is (generally) defined as 1.5, and the IQR (inner quartile range) is defined as:

IQR = Q3 - Q1 = qn(0.75) - qn(0.25)

Example:

The following dataset can be visualised as:

array([ 65.46329369,  91.64897781,  96.85666088,  60.18189851,
        30.53996122,  55.12666144,  63.00161253,  29.97804178,
        ...,
        47.98458963,  37.69556267,  44.26758617,  58.60869412,
        150.        , 155.        , 160.        , 165.        ,
        170.        , 175.        ])

enter image description here

To extract the outliers (we'll focus on the upper outliers), we first need to know the IQRs, which can be found using:

pandas.Series(data).describe()

Output:

count    106.000000
mean      62.569111
std       29.698729
min        0.000000
25%       46.934198
50%       57.002615
75%       69.516237
max      175.000000

Determine the approximate whisker values:

iqr = (69.516 - 46.934)
upper = 69.516 + (iqr*1.5)
lower = 46.934 - (iqr*1.5)

>>> iqr, upper, lower
>>> (22.582, 103.389, 13.06)

Extract (examine) the values of the upper outliers:

data[data > upper]

>>> array([150., 155., 160., 165., 170., 175.])

Este artículo se recopila de Internet, indique la fuente cuando se vuelva a imprimir.

En caso de infracción, por favor [email protected] Eliminar

Editado en
0

Déjame decir algunas palabras

0Comentarios
Iniciar sesiónRevisión de participación posterior

Artículos relacionados

How can I remove the corresponding Y values that correspond to the deleted outliers in X columns in Python

How can I remove the corresponding Y values that correspond to the deleted outliers in X columns in Python

How can I print subelements in Python?

How can I use SVM classifier to detect outliers in percentage changes?

How can I flush the output of the print function (unbuffer python output)?

How can I print cPacket?

Assign ID to outliers in plotly boxplot

Selenium Python I can iterate over the html table how do I print the values from column 3

How can I print multidimensional arrays in C?

How can I suppress (not print) line numbers?

How can I print a vector in a recursive function?

How can I print objects to the console?

No outliers in ggplot boxplot with facet_wrap

How can generate impulse as outliers on periodic or sequenced-based data for doing experiments via outliers detection methods?

How can I add the 5 quantiles of the quantile function to a boxplot in ggplot2 with one variable?

Boxplot appear differently in definition in Jupyter Book, how can I do? (Windows 10)

How can I print numbers between two numbers that I enter?

How do i remove outliers using multiple columns pandas?

How can i print json object with some other text

How i can print a number triangle in c++

How can I print the filename which is being processes by xmltask?

How can I keep input track log in shiny, then print it and save it?

how can i print the component's id of Vue.js

Gratient Module how can i print text in the same line

How can I print a PowerShell hash object as a hash object?

How can I print a Numpy Array as a result from a function?

How can i change x in print("",end=x) at end of loop?

How can I create a two column per page print layout?

How can I print a value rather than a tensor?