[Python] No outlier detection in boxplot

Discussão em 'Python' iniciado por Stack, Abril 22, 2025.

  1. Stack

    Stack Membro Participativo

    I would like to plot boxplots of dataframes (see sample code below). What I'm wondering is: How can I disable the detection of outlier? I don't want to remove them, I just want a plot which visualizes the data by marking 0%, 25%, 50% and 75% of the datapoints without considering any criteria for outliers etc.

    How do I have to modify my code to achieve this? Can I change the outlier detection criteria in a way that it behaves like disabled?

    I would be very grateful for any help and if there is already another threat about this (which I didn't find), I would be happy to get a link to it.

    Many thanks! Jordin

    import numpy as np
    import pandas as pd
    import matplotlib.pyplot as plt

    np.random.seed(1234)
    df = pd.DataFrame(np.random.randn(10, 4),
    columns=['Col1', 'Col2', 'Col3', 'Col4'])

    plt.figure()
    plt.boxplot(df.values)
    plt.show()


    EDIT:

    [​IMG]

    I would like to include this outlier when drawing the whiskers and not just not show it.

    Continue reading...

Compartilhe esta Página