I have a csv file that I open with Pandas. It looks like this:
"Patient","Visit","Feature1","Feature2","Feature3"
"P1",0,?,?,?
"P1",1,?,?,?
"P2",0,?,?,?
"P2",1,?,?,?
"P2",2,?,?,?
"P3",0,?,?,?
"P3",1,?,?,?
?
being a numerical value.
I know how to display one feature at a time (because they have various ranges) and separated per patient:
seaborn.stripplot(y="Feature1", x="Patient", data=features)
I would like to display ALL the plots inside a single image, like a mapping. How can I do it?
Seaborn usually prefers the "long form" of the dataframe, which can be obtained via pandas'
melt
.To get each feature in separate subplots, you can use
catplot
on the melted dataframe (usesharey=True
if all features are in about the same range; usecol_wrap=3
to start a new row every 3 columns):