Two Boxplots in one graph

Hello fellas,

I extracted the first and second half of a column of a csv data. They have different length. Now I want to put them in the same graph with a nice legend. Can somebody please help. Here is the code and the csv data.

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

df = pd.read_csv (r’/home/dieter/.config/spyder-py3/cardio.csv’) df = pd.read_csv(“cardio.csv”, usecols = [‘blutdruck’,‘target’]) print(df)

eins = df.loc[0:164, ‘blutdruck’:‘target’] null = df.loc[165:302, ‘blutdruck’:‘target’]

boxplot_eins = eins.boxplot(column=[‘blutdruck’])

boxplot_null = null.boxplot(column=[‘blutdruck’])

Here is the link to the csv data → Dropbox - cardio.csv - Simplify your life

and here the code in python format → Dropbox - ML_Projekt.py - Simplify your life

Thanks in advance!

Hi Eber,

Help us to help you! And other people like you.

Why did you post this question under a topic about the Python Software
Foundation? You had to scroll past the Users topic to get to it. How can
we make it easier for people to understand that questions from users
about Python should go into the Users topic?

The Users topic says:

General discussion forum for the Python programming language. All welcome.

What could we have written instead to make it more clear that you should
ask your question there?

I doubt you will get any answers in this topic, which is for asking
questions about the Python Software Foundation. If you don’t know what
the PSF is, then your question certainly has nothing to do with it.