1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
U
­ý°dä1ã@sddlZddlZddlZddlmmZddlm    Z    ddl
m Z ddl mZmZejdd„ƒZejGdd„deƒƒZejGdd    „d    eƒƒZdS)
éN)Ú    DataFrame)Ú TestPlotBaseÚ_check_plot_workscCsZtj d¡ttj dd¡ddgd}tj ddd    gd¡|d
<tj ddd    gd¡|d <|S) NrééÚAÚB©ÚcolumnsÚaÚbÚcÚCÚD)ÚnpÚrandomÚseedrZrandnÚchoice)Údf©rúcd:\z\workplace\vscode\pyvenv\venv\Lib\site-packages\pandas/tests/plotting/frame/test_hist_box_by.pyÚhist_dfs
 rc@s²eZdZejjej ddddddgdggdfdddgdddgddggdfdd    dddgddggdfdd
gdd d d ddddddg    dggdfdd
gddgd d d ddddddg    ddggdfdd
gd    d d d ddddddg    ddggdfg¡dd„ƒƒZej ddddddgdggdfdd    dddgddggdfdd
gdd d d ddddddg    dggdfg¡dd„ƒZej dgdgfgddgfddddgfg¡dd„ƒZ    ejjej ddgdd dfd!dgdgd"dfd#dddgd$dfdd
gdd%dfdd
gdd&dfdd
gdgd'dfdd
gddgd%dfdd
gd    d%dfdd
gddgd'dfg ¡d(d)„ƒƒZ
ej d*d+dd
gd,fe   d-¡dd.fd/g¡d0d1„ƒZ ejjd2d3„ƒZejjd4d5„ƒZej d6d7d8g¡d9d:„ƒZd    S);ÚTestHistWithByzby, column, titles, legendsrrr r r érNrú(a, a)ú(a, b)ú(a, c)ú(b, a)ú(b, b)ú(b, c)ú(c, a)ú(c, b)ú(c, c)é    c    CsLt|jj||dd}dd„|Dƒ}dd„|Dƒ}||ks<t‚||ksHt‚dS)NT)ÚcolumnÚbyÚ default_axescSsg|] }| ¡‘qSr©Z    get_title©Ú.0ZaxrrrÚ
<listcomp>Ysz=TestHistWithBy.test_hist_plot_by_argument.<locals>.<listcomp>cSs g|]}dd„| ¡jDƒ‘qS)cSsg|] }| ¡‘qSr©Zget_text©r)Zlegendrrrr*[szHTestHistWithBy.test_hist_plot_by_argument.<locals>.<listcomp>.<listcomp>©Z
get_legendZtextsr(rrrr*Zs)rÚplotÚhistÚAssertionError)    Úselfr%r$ÚtitlesÚlegendsrÚaxesÚ result_titlesÚresult_legendsrrrÚtest_hist_plot_by_arguments;ÿÿ z)TestHistWithBy.test_hist_plot_by_argumentrc
Csd| ¡}|jddid}t|jjd||d}dd„|Dƒ}dd„|Dƒ}    |    |ksTt‚||ks`t‚dS)    Nrrr    T©r&r$r%cSsg|] }| ¡‘qSrr'r(rrrr*~sz6TestHistWithBy.test_hist_plot_by_0.<locals>.<listcomp>cSs g|]}dd„| ¡jDƒ‘qS)cSsg|] }| ¡‘qSrr+r,rrrr*€szATestHistWithBy.test_hist_plot_by_0.<locals>.<listcomp>.<listcomp>r-r(rrrr*s)ÚcopyÚrenamerr.r/r0)
r1r%r$r2r3rrr4r5r6rrrÚtest_hist_plot_by_0asÿ z"TestHistWithBy.test_hist_plot_by_0ú
by, column)rNrc    Cs6d}tjt|dt|jjd||dW5QRXdS©NzNo group keys passed©ÚmatchTr8)ÚpytestÚraisesÚ
ValueErrorrr.r/©r1r%r$rÚmsgrrrÚ)test_hist_plot_empty_list_string_tuple_by†s ÿz8TestHistWithBy.test_hist_plot_empty_list_string_tuple_byúby, column, layout, axes_num©rr)rrrGr)ér)rN©rrHrrI)r#rH)rr)érc    CsBtjtddt|jj|||d}W5QRX|j|||ddS)NF)Zcheck_stacklevel©r$r%Úlayout©Úaxes_numrL)ÚtmZassert_produces_warningÚ UserWarningrr.r/Ú_check_axes_shape©r1r%r$rLrNrr4rrrÚtest_hist_plot_layout_with_by—sÿz,TestHistWithBy.test_hist_plot_layout_with_byúmsg, by, layoutúlarger than required size©rHrHú)Layout must be a tuple of (rows, columns)©rH©z1At least one dimension of layout must be positiver)éÿÿÿÿrZc    Cs4tjt|d|jjddg||dW5QRXdS©Nr>rrrK)r@rArBr.r/©r1rDr%rLrrrrÚ,test_hist_plot_invalid_layout_with_by_raises±s z;TestHistWithBy.test_hist_plot_invalid_layout_with_by_raisescCsÌ|jjdddd\}}}| |¡ ||¡s.t‚| |¡ ||¡sDt‚| |¡ ||¡sZt‚| |¡ ||¡spt‚| |¡ ||¡r†t‚| |¡ ||¡rœt‚| |¡ ||¡r²t‚| |¡ ||¡rÈt‚dS)NrrT)r$r%Zsharex)r.r/Ú
get_x_axisÚjoinedr0Ú
get_y_axis©r1rZax1Zax2Zax3rrrÚtest_axis_share_x_with_by¿sz(TestHistWithBy.test_axis_share_x_with_bycCsÌ|jjdddd\}}}| |¡ ||¡s.t‚| |¡ ||¡sDt‚| |¡ ||¡sZt‚| |¡ ||¡spt‚| |¡ ||¡r†t‚| |¡ ||¡rœt‚| |¡ ||¡r²t‚| |¡ ||¡rÈt‚dS)NrrT)r$r%Zsharey)r.r/r`r_r0r^rarrrÚtest_axis_share_y_with_byÐsz(TestHistWithBy.test_axis_share_y_with_byÚfigsize©é é©éé
cCs&|jjdd|d}|j|d|ddS)Nrr©r$r%rdr©rNrd)r.r/rQ©r1rdrr4rrrÚtest_figure_shape_hist_with_byász-TestHistWithBy.test_figure_shape_hist_with_by)Ú__name__Ú
__module__Ú __qualname__r@ÚmarkÚslowÚ parametrizer7r;rErSÚreÚescaper]rbrcrnrrrrrsà÷
ò÷ ò÷ òÜþ8 ÷
òýþ
 
 
üþ    
 õþ      ýþ
 
 
rc@sþeZdZej ddddgdddggfddgddgdd    d
d d d dddg    gfdddgddgdddggdfddgddgddgdd    d
d d d dddg    gdfdgdddgdddggdfg¡dd„ƒZej ddddgdddggfddgddgdd    d
d d d dddg    gfddddgdddggdfg¡dd„ƒZej dgdgfdgdfdddgfg¡dd„ƒZejj    ej ddgddd fd!d"dddgd#dfddgddd fddgdd#dfg¡d$d%„ƒƒZ
ej d&d'ddgdfe   d(¡dd)fd*g¡d+d,„ƒZ ej d-d.d/g¡d0d1„ƒZdS)2Ú TestBoxWithByzby, column, titles, xticklabelsrrr r r rrrrrrrr r!r"rrNc    CsLt|jjd||d}dd„|Dƒ}dd„|Dƒ}||ks<t‚||ksHt‚dS)NTr8cSsg|] }| ¡‘qSrr'r(rrrr*sz;TestBoxWithBy.test_box_plot_by_argument.<locals>.<listcomp>cSsg|]}dd„| ¡Dƒ‘qS)cSsg|] }| ¡‘qSrr+©r)Úlabelrrrr*szFTestBoxWithBy.test_box_plot_by_argument.<locals>.<listcomp>.<listcomp>©Zget_xticklabelsr(rrrr*s)rr.Úboxr0)    r1r%r$r2Ú xticklabelsrr4r5Úresult_xticklabelsrrrÚtest_box_plot_by_argumentês/ÿÿ z'TestBoxWithBy.test_box_plot_by_argumentrc
Csd| ¡}|jddid}t|jjd||d}dd„|Dƒ}dd„|Dƒ}    |    |ksTt‚||ks`t‚dS)    Nrrr    Tr8cSsg|] }| ¡‘qSrr'r(rrrr*Csz4TestBoxWithBy.test_box_plot_by_0.<locals>.<listcomp>cSsg|]}dd„| ¡Dƒ‘qS)cSsg|] }| ¡‘qSrr+rxrrrr*Esz?TestBoxWithBy.test_box_plot_by_0.<locals>.<listcomp>.<listcomp>rzr(rrrr*Ds)r9r:rr.r{r0)
r1r%r$r2r|rrr4r5r}rrrÚtest_box_plot_by_0$sÿ z TestBoxWithBy.test_box_plot_by_0r<)rrrc    Cs6d}tjt|dt|jjd||dW5QRXdSr=)r@rArBrr.r{rCrrrÚ%test_box_plot_with_none_empty_list_byKs z3TestBoxWithBy.test_box_plot_with_none_empty_list_byrFrVrH)rrrVrH)rN)rrHr)rHrcCs*t|jjd|||d}|j|||ddS)NT)r&r$r%rLrM)rr.r{rQrRrrrÚtest_box_plot_layout_with_byZsÿz*TestBoxWithBy.test_box_plot_layout_with_byrTrUrWrXrYc    Cs4tjt|d|jjddg||dW5QRXdSr[)r@rArBr.r{r\rrrÚ+test_box_plot_invalid_layout_with_by_raisesms z9TestBoxWithBy.test_box_plot_invalid_layout_with_by_raisesrdrerhcCs&|jjdd|d}|j|d|ddS)NrrrkrHrl)r.r{rQrmrrrrn{sz,TestBoxWithBy.test_figure_shape_hist_with_by)rorprqr@rrrtr~rr€rsrrurvr‚rnrrrrrwèsº÷ÿü÷ÿ óüØþ-
÷ÿüìþ
 
üþ    
 úþ  ýþ
rw)ruÚnumpyrr@Zpandas.util._test_decoratorsÚutilZ_test_decoratorsÚtdZpandasrZpandas._testingZ_testingrOZpandas.tests.plotting.commonrrZfixturerZskip_if_no_mplrrwrrrrÚ<module>s  
O