Dataframe show a boxplot for each day

Viewed 38

i got a DataFrmae(choosen_merged):

enter image description here

        ax = choosen_merged.boxplot()
        ax.set_title("Boxplot"+" Sensor: "+f"{pick_column}"+" "+f"{df_date}")
        #ax.set_xlabel("x_label")
        ax.set_ylabel(f"{a_string}")
        plt.show()

Output:

enter image description here

Objective: I would like to get a boxplot for each day from my df.

Solution approach:

have found a similar approach, but unfortunately it does not help me further Time-series boxplot in pandas

The last answer also works with timestamps but in the index. How can I apply it to a column?

1 Answers

An example that should work for this particular problem:

# Setting up our x-axis, the longtime column has to be of dtype 'datetime'
choosen_merged['days'] = choosen_merged.longtime.dt.day
# Using sb.boxplot, you can also use matplotlib.pyplot.boxplot
import seaborn as sb
sb.boxplot(data=choosen_merged, x='days', y='temperature_ers_lite_1_wermser_0_elsys_0')
Related