Bookmark pandas boxes next to each other in iPython Notebook

I am trying to print three pandas frames next to each other in an iPython Notebook.

Each data frame is as follows:

sub    cond   accuracy
s1     A      0.814868
s2     A      0.504574
s3     A      0.438314
s4     A      0.956235
s5     A      0.370771
s1     B      0.228724
s2     B      0.691374
s3     B      0.237314
s4     B      0.32633
s5     B      0.859961 

When I draw precision without a subset by condition, this works fine:

fig, axes = plt.subplots(nrows=1, ncols=3)
for i, df in enumerate([df1, df2, df3]):
    df.boxplot('accuracy',ax=axes[i])

However, when I try to build precision by condition for each data block, using instead:

df.boxplot('accuracy',by='cond',ax=axes[i])

only the last graph is displayed (and not where it should be in accordance with the purpose of its axes).

What's happening? Is there a better way to build boxes like this next to each other in iPython Notebook?

+4
source share

Source: https://habr.com/ru/post/1538127/


All Articles