
    Mhr                         S r SSKrSSKrSSKrSSKrSSKJrJrJ	r	J
r
JrJr  SSKJr  SSKJrJrJrJrJr  SSKJr  \R0                  " S5      r\R0                  " S5      rS r " S	 S
5      r " S S5      rg)zTest cases for .boxplot method     N)	DataFrame
MultiIndexSeries
date_rangeplottingtimedelta_range)_check_axes_shape_check_box_return_type_check_plot_works_check_ticks_props_check_visible)pprint_thing
matplotlibzmatplotlib.pyplotc                 |    UR                  5       u  p#X R                  5       ::  d   eX0R                  5       :  d   eg N)get_ylimminmax)colaxy_miny_maxs       [/var/www/html/env/lib/python3.13/site-packages/pandas/tests/plotting/test_boxplot_method.py_check_ax_limitsr       s3    ;;=LEGGIGGI    c                   t   \ rS rSrS r\R                  R                  \R                  R                  SSS0S/SSS	/0S/SS	/S
S.\	/S/S
S/S.S/SS
0\	/SS
S/0\	/SS0S/S
SS.\	//5      S 5       5       r
S rS rS rS rS rS rS rS r\R                  R                  S/ SQ5      S 5       rS rS rS rS rS  rS! r\R                  R                  S"S#S$S%S&S'.S#S$S%S&S'.4S(S#0S(S#04S#S#S#S#S#S'.4/5      S) 5       r\R                  R                  S*S+S,S,S-S,S'.4S.S/S/S0S/S'.4/5      S1 5       r\R                  R                  S2S#S#S3.S44/5      S5 5       r\R                  R                  S6/ S7Q5      S8 5       r\R                  R                  S9S:S;/5      S< 5       r\R                  R                  S9S:S;/5      S= 5       r\R                  R                  S9S:S;/5      S> 5       r \R                  R                  S9S:S;/5      S? 5       r!\R                  R                  S9S:S;/5      S@ 5       r"SAr#g)BTestDataFramePlots&   c                 |   SS K Jn  Sn[        [        R                  R                  S5      R                  / SQU5      [        R                  R                  S5      R                  / SQU5      [        R                  R                  S5      R                  / SQU5      S.[        R                  " SU5      S9nUR                  SSS	9nUR                  5        Vs/ s H  n[        UR                  5       5      PM     snUR                  R                  5       :X  d   eUR                  [        R                  " SSS
5      5        UR                  5         UR                  5        Vs/ s H  n[        UR                  5       5      PM     sn[!        [        R                  " SSS
5      5      :X  d   eg s  snf s  snf )Nr   P      )r      r!      )Clinical	Confirmed	DiscardedindexbarT)kindstacked
   )matplotlib.pyplotpyplotr   nprandomdefault_rngchoicearangeplotget_xticklabelsintget_textr(   to_list
set_xticksdrawlist)selfpltndfr   xs         r   test_stacked_boxplot_set_axis0TestDataFramePlots.test_stacked_boxplot_set_axis'   sV   'II11!4;;L!LYY2215<<\1MYY2215<<\1M
 ))Aq/
 WW%W.+-+=+=+?@+?aAJJL!+?@BHHDTDTDVVVV
bii2r*+
+-+=+=+?@+?aAJJL!+?@DIIaR E
 
 	
 
 A As   #F4(#F9zkwargs, warnreturn_typedictNcolumnonetwoindic)rE   byindic2rI   notchr"   )rI   rK   c                 \   [        [        R                  R                  S5      R	                  S5      [        [        R                  S S 5      / SQS9nSS/S-  US	'   / S
QS-  US'   [        R                  " USS9   [        UR                  40 UD6  S S S 5        g ! , (       d  f       g = f)Nr!         rN   rF   rG   threefourr(   columnsfoor)   r#   rH   )rU   r)   rU   rJ   Fcheck_stacklevel)r   r/   r0   r1   standard_normalr;   stringascii_letterstmassert_produces_warningr   boxplot)r<   kwargswarnr?   s       r   test_boxplot_legacy1'TestDataFramePlots.test_boxplot_legacy1<   s     II!!!$44V<v++BQ/03

 enq(7,q08 ''uEbjj3F3 FEEs   =B
B+c                     [        [        R                  R                  S5      R	                  S5      5      n[        [        R                  R                  USS9  g )Nr!   rN   rD   )datarC   )	r   r/   r0   r1   rX   r   r   _corer]   )r<   sers     r   test_boxplot_legacy1_series.TestDataFramePlots.test_boxplot_legacy1_seriesW   s<    RYY**1-==a@A(..00sOr   c                 F   [        [        R                  R                  S5      R                  S5      SS/S9n[	        / SQ5      US'   [	        S/S	-  5      US
'   [
        R                  " [        SS9   [        UR                  SS9  S S S 5        g ! , (       d  f       g = f)Nr!   r,   r!   Col1Col2rT   
Arn   rn   rn   rn   Bro   ro   ro   ro   Xrn   r,   YFrV   rI   )
r   r/   r0   r1   r   r[   r\   UserWarningr   r]   r<   r?   s     r   test_boxplot_legacy2'TestDataFramePlots.test_boxplot_legacy2[   s    II!!!$++G4vv>N
 KL3#$3''eLbjjS1 MLLs   4B
B c                 >   [        [        R                  R                  S5      R                  S5      SS/S9n[	        / SQ5      US'   [	        S/S	-  5      US
'   [
        R                  R                  5       u  p#UR                  SSUS9nUR                  nXTL d   eg )Nr!   ri   rj   rk   rl   rm   rp   rn   r,   rq   )rI   r   )
r   r/   r0   r1   r   mplr.   subplotsr]   axes)r<   r?   _r   rz   ax_axess         r   test_boxplot_legacy2_with_ax/TestDataFramePlots.test_boxplot_legacy2_with_axd   s    II!!!$++G4vv>N
 KL3#$3 

##%zz&SRz0''r   c                 `   [        [        R                  R                  S5      R                  S5      SS/S9n[	        / SQ5      US'   [	        S/S	-  5      US
'   [
        R                  R                  5       u  p#UR                  S
5      R                  USS9nUR                  nXTS   L d   eg )Nr!   ri   rj   rk   rl   rm   rp   rn   r,   rq   rz   r   rC   )r   r/   r0   r1   r   rx   r.   ry   groupbyr]   rz   )r<   r?   figr   rz   r|   s         r   (test_boxplot_legacy2_with_ax_return_type;TestDataFramePlots.test_boxplot_legacy2_with_ax_return_typeq   s    II!!!$++G4vv>N
 KL3#$3**%%'zz#&&"&&A''s)###r   c                    [        [        R                  R                  S5      R                  S5      SS/S9n[	        / SQ5      US'   [	        S/S	-  5      US
'   [
        R                  R                  5       u  p#[        R                  " [        5         UR                  SS/SUSS9nS S S 5        WS   R                  5       UL d   eg ! , (       d  f       N'= f)Nr!   ri   rj   rk   rl   rm   rp   rn   r,   rq   rz   )rE   rI   r   rC   )r   r/   r0   r1   r   rx   r.   ry   r[   r\   rs   r]   
get_figure)r<   r?   r   r   rz   s        r   #test_boxplot_legacy2_with_multi_col6TestDataFramePlots.test_boxplot_legacy2_with_multi_col|   s    II!!!$++G4vv>N
 KL3#$3**%%'''4::'CBF  D 5 F|&&(C///	 54s   C
Cc                    [        [        R                  R                  S5      R                  S5      SS/S9n[	        / SQ5      US'   [	        S/S	-  5      US
'   [
        R                  R                  5       u  p#UR                  USS9n[        [        R                  R                  UR                  5       5      5      n[        UR                  5       5      [        U5      :X  d   eg )Nr!   ri   rj   rk   rl   rm   rp   rn   r,   rq   rD   r   )r   r/   r0   r1   r   rx   r.   ry   r]   r;   	itertoolschainfrom_iterablevalueslen	get_lines)r<   r?   r{   r   dliness         r   test_boxplot_legacy2_by_none/TestDataFramePlots.test_boxplot_legacy2_by_none   s    II!!!$++G4vv>N
 KL3#$3 

##%JJ"&J1Y__22188:>?2<<>"c%j000r   c                 z    UR                  5       n[        U[        R                  R                  5      (       d   eg r   )r]   
isinstancerx   r.   Axes)r<   hist_dfresults      r   test_boxplot_return_type_none0TestDataFramePlots.test_boxplot_return_type_none   s)    "&#**//2222r   c                 j   [        [        R                  R                  S5      R	                  S5      [        [        R                  S S 5      / SQS9nSn[        R                  " [        US9   UR                  SS	9  S S S 5        UR                  5       n[        US
5        g ! , (       d  f       N+= f)Nr!   rM   rN   rP   rS   z,return_type must be {'axes', 'dict', 'both'}match
NOT_A_TYPErC   rz   )r   r/   r0   r1   rX   r;   rY   rZ   pytestraises
ValueErrorr]   r
   )r<   r?   msgr   s       r   test_boxplot_return_type_legacy2TestDataFramePlots.test_boxplot_return_type_legacy   s     II!!!$44V<v++BQ/03

 =]]:S1JJ<J0 2 vv.	 21s   /B$$
B2rD   rz   bothc                 @   [        [        R                  R                  S5      R	                  S5      [        [        R                  S S 5      / SQS9n[        R                  " S5         UR                  US9nS S S 5        [        WU5        g ! , (       d  f       N= f)Nr!   rM   rN   rP   rS   Fr   )r   r/   r0   r1   rX   r;   rY   rZ   r[   r\   r]   r
   )r<   rC   r?   r   s       r   +test_boxplot_return_type_legacy_return_type>TestDataFramePlots.test_boxplot_return_type_legacy_return_type   s{     II!!!$44V<v++BQ/03

 ''.ZZKZ8F /v{3 /.s   *B
Bc                 ,   UR                  5       n[        R                  R                  S5      R	                  SSUR
                  S   5      US'   UR                  SS/SS	9u  p4[        US   U5        [        US   U5        UR                  U:X  d   eg )
Nr!   r"      r   ageheightweightcategoryrr   	copyr/   r0   r1   integersshaper]   r   _sharey)r<   r   r?   	height_ax	weight_axs        r   test_boxplot_axis_limits+TestDataFramePlots.test_boxplot_axis_limits   s    \\^II))!,55aRXXa[I5	!zz8X*>:zN	Hy1Hy1  I---r   c                    UR                  5       n[        R                  R                  S5      R	                  SSUR
                  S   5      US'   UR                  / SQSS9nUS	   US
   US   penUS   n[        US   U5        [        US   U5        [        US   U5        UR                  U:X  d   eUR                  U:X  d   eUR                  b   eg )Nr!   r"   r   r   r   )r   r   r   r   rr   )r   r   )r   r"   )r"   r   r"   r"   r   r   r   )r<   r   r?   pr   r   age_axdummy_axs           r   !test_boxplot_axis_limits_two_rows4TestDataFramePlots.test_boxplot_axis_limits_two_rows   s    \\^II))!,55aRXXa[I5	JJ2zJB'(w$4f	T7Hy1Hy1EF+  I---~~***'''r   c                     [        [        R                  R                  S5      R	                  S5      5      n[        R
                  UR                  S S 2S4'   [        UR                  SS9  g )Nr!   )r   rO   r   rz   r   )	r   r/   r0   r1   rX   nanlocr   r]   rt   s     r   test_boxplot_empty_column,TestDataFramePlots.test_boxplot_empty_column   sI    ryy,,Q/??HIvvq!t"**&9r   c                 ,   [        [        R                  R                  S5      R                  S5      / SQS9nUR	                  SSS9nUR
                  R                  R                  S:X  d   eUR
                  R                  R                  S	:X  d   eg )
Nr!   )r,      )rn   ro   CDErl   rz   )      )rC   figsizer   r   )	r   r/   r0   r1   r]   figurebbox_incheswidthr   )r<   r?   r   s      r   test_figsizeTestDataFramePlots.test_figsize   s|    II!!!$++G4>W
 @}}((.."444}}((//1444r   c                 T    [        S/ SQ05      n[        UR                  SSS9SSS9  g )Nar"   r!   r#   rO   r   rN      )fontsize
xlabelsize
ylabelsizer   r   r]   rt   s     r   test_fontsize TestDataFramePlots.test_fontsize   s,    /012::cB:7BSUVr   c                    [        [        SSS9[        R                  R	                  S5      R                  S5      [        R                  R	                  S5      R                  S5      S-   [        SSS9R                  [        5      [        SSSS9[        SSS9S.5      nUR                  S	S
9nUR                  5        Vs/ s H  o3R                  5       PM     snSS/:X  d   eg s  snf )Nz
2012-01-01d   )periodsr!   UTC)r   tzz1 days)r   bcr   efbox)r*   r   r   )r   r   r/   r0   r1   rX   astypestrr   r4   r5   r7   )r<   r?   r   r@   s       r   test_boxplot_numeric_data,TestDataFramePlots.test_boxplot_numeric_data   s    c:YY**1-==cBYY**1-==cBQFc:AA#FceD$Xs;	
 WW%W &(&8&8&:;&:

&:;SzIII;s   C(zcolors_kwd, expectedrr   gr   )boxeswhiskersmedianscapsr   c                     [        [        R                  R                  S5      R                  S5      5      nUR	                  USS9nUR                  5        H   u  pVXE   S   R                  5       U:X  a  M    e   g )Nr!   ri   rD   colorrC   r   )r   r/   r0   r1   r]   items	get_color)r<   
colors_kwdexpectedr?   r   kvs          r   test_color_kwd!TestDataFramePlots.test_color_kwd   sj     ryy,,Q/66w?@*&ANN$DA9Q<))+q000 %r   zscheme,expecteddark_backgroundz#8dd3c7z#bfbbd9defaultz#1f77b4z#2ca02cc                 N   [        [        R                  R                  S5      R                  S5      5      nSS KJn  UR                  R                  U5        UR                  R                  SS9nUR                  5        H   u  pgXV   S   R                  5       U:X  a  M    e   g )Nr!   ri   r   rD   r   )r   r/   r0   r1   r-   r.   styleuser4   r   r   r   )r<   schemer   r?   r=   r   r   r   s           r   test_colors_in_theme'TestDataFramePlots.test_colors_in_theme  s    2 ryy,,Q/66w?@'		f0NN$DA9Q<))+q000 %r   zdict_colors, msg)r   invalid_keyzinvalid key 'invalid_key'c                     [        [        R                  R                  S5      R                  S5      5      n[        R
                  " [        US9   UR                  USS9  S S S 5        g ! , (       d  f       g = f)Nr!   ri   r   rD   r   )r   r/   r0   r1   r   r   r   r]   )r<   dict_colorsr   r?   s       r   test_color_kwd_errors(TestDataFramePlots.test_color_kwd_errors#  sR     ryy,,Q/66w?@]]:S1JJ[fJ= 211s   A++
A9zprops, expected))boxpropsr   )whiskerpropsr   )cappropsr   )medianpropsr   c           	         [        S Vs0 s H1  o3[        R                  R                  S5      R                  S5      _M3     sn5      nUSS00nUR                  " S	SS0UD6nXb   S   R                  5       S:X  d   eg s  snf )
NABCr!   r,   r   C1rC   rD   r    )r   r/   r0   r1   r]   r   )r<   propsr   r   r?   kwdr   s          r   test_specified_props_kwd+TestDataFramePlots.test_specified_props_kwd-  s     N1299003::2>>NOwo&66#6",,.$666	 Os   8A?vertTFc                    [        [        R                  R                  S5      R	                  S5      [        R                  R                  S5      R	                  S5      [        R                  R                  S5      R                  SS/S5      S.5      nSu  p4UR                  SXUS9nUR                  5       U:X  d   eUR                  5       U:X  d   eg )	Nr!   r,   group1group2r   r   groupr@   yr   )r*   r  xlabelylabel)	r   r/   r0   r1   rX   r2   r4   
get_xlabel
get_ylabelr<   r  r?   r  r  r   s         r   test_plot_xlabel_ylabel*TestDataFramePlots.test_plot_xlabel_ylabel>  s    YY**1-==bAYY**1-==bA..q188(H9MrR
 "WW%d&WI}}&(((}}&(((r   c                    [         R                  R                  S5      n[        UR	                  SSSS9[        S5      S9n[        UR	                  SSSS9[        S5      S9nSu  pV[        R                  SS	S
S9u  pxUR                  R                  US   XUS9  UR                  R                  US   XUS9  U H/  n	U	R                  5       U:X  d   eU	R                  5       U:X  a  M/   e   [        R                  R                  5         g )Nr!   r   r   )r   rO   sizeABCDrl   r  )r,      T)ncolsr   sharey)r   r  r  r  r"   )r/   r0   r1   r   r   r;   r=   ry   r4   r   r   r!  rx   r.   close)
r<   r  rngdf1df2r  r  r{   axsr   s
             r   test_plot_box TestDataFramePlots.test_plot_boxL  s     ii##A&Q(;T&\RQ(;T&\R!AwtDATHATHB==?f,,,==?f,,,  	

r   c                    [        [        R                  R                  S5      R	                  S5      [        R                  R                  S5      R	                  S5      [        R                  R                  S5      R                  SS/S5      S.5      nSu  p4UR                  XUS9nUR                  5       U:X  d   eUR                  5       U:X  d   eg )Nr!   r,   r  r  r  r  )r  r  r  )	r   r/   r0   r1   rX   r2   r]   r   r!  r"  s         r   test_boxplot_xlabel_ylabel-TestDataFramePlots.test_boxplot_xlabel_ylabel\  s    YY**1-==bAYY**1-==bA..q188(H9MrR
 "ZZTZ@}}&(((}}&(((r   c                     [        [        R                  R                  S5      R	                  S5      [        R                  R                  S5      R	                  S5      [        R                  R                  S5      R                  SS/S5      S.5      nSu  p4UR                  SXUS9nU H/  nUR                  5       U:X  d   eUR                  5       U:X  a  M/   e   [        R                  R                  5         g )	Nr!   r,   r  r  r  r  r  )rI   r  r  r  )r   r/   r0   r1   rX   r2   r]   r   r!  rx   r.   r,  )r<   r  r?   r  r  r   subplots          r    test_boxplot_group_xlabel_ylabel3TestDataFramePlots.test_boxplot_group_xlabel_ylabelj  s    YY**1-==bAYY**1-==bA..q188(H9MrR
 "ZZ7VZLG%%'6111%%'6111  	

r   c                    [        [        R                  R                  S5      R	                  S5      [        R                  R                  S5      R	                  S5      [        R                  R                  S5      R                  SS/S5      S.5      nUR                  SUS9nU H<  nU(       a  UR                  5       OUR                  5       nU[        S/5      :X  a  M<   e   [        R                  R                  5         g )Nr!   r,   r  r  r  r  )rI   r  )r   r/   r0   r1   rX   r2   r]   r   r!  r   rx   r.   r,  )r<   r  r?   r   r7  target_labels         r   #test_boxplot_group_no_xlabel_ylabel6TestDataFramePlots.test_boxplot_group_no_xlabel_ylabelz  s    YY**1-==bAYY**1-==bA..q188(H9MrR
 ZZ7Z.G377--/W=O=O=QL<	#::::  	

r   r  )$__name__
__module____qualname____firstlineno__rA   r   markslowparametrizers   r`   rf   ru   r}   r   r   r   r   r   r   r   r   r   r   r   r   r   r  r  r  r#  r1  r4  r8  r<  __static_attributes__r  r   r   r   r   &   s+   
* [[[[V$d+'.g6D':;TBG_k*Wh'(+6q\4 a(+6		
4 4P2	$013
/ [[],DE
4 F
4.(:
5WJ [[ 33L33L s^gs^,CSS#NO	

1
1 [[ "& )(%	 & )(%		
.1/.1 [[
,.I	JK>	> [[	
77 [[VdE]3) 4) [[VdE]3 4 [[VdE]3) 4) [[VdE]3 4 [[VdE]3 4r   r   c            
          \ rS rSrS rS r\R                  R                  S 5       r	\R                  R                  S 5       r
\R                  R                  SS\SS	// S
Q/5      S 5       rS rS r\R                  R                  S 5       r\R                  R                  S 5       r\R                  R                  \R                  R                  S/ SQ5      S 5       5       r\R                  R                  \R                  R                  S/ SQ5      S 5       5       r\R                  R                  S 5       r\R                  R                  S 5       r\R                  R                  S 5       r\R                  R                  \R                  R                  S/ SQ/ SQ/ SQ/5      S 5       5       r\R                  R                  \R                  R                  SSS/SS/S S//5      S! 5       5       r\R                  R                  S" 5       r\R                  R                  \R                  R                  S#S$S%/5      S& 5       5       r\R                  R                  \R                  R                  S'S(S(/S%S//5      S) 5       5       r\R                  R                  \R                  R                  S*S(S(/S%S//5      S+ 5       5       r\R                  R                  S, 5       r\R                  R                  S- 5       r\R                  R                  S. 5       rS/ r \R                  R                  S0S1/ S2Q4S1// S2Q4S3/ S4Q4S1S3// S5Q4S6/ S5Q4/5      S7 5       r!S8 r"S9 r#S:r$g6);TestDataFrameGroupByPlotsi  c                     UR                  SS9n[        R                  " [        SS9   [	        UR
                  SS9nS S S 5        [        [        WR                  5      SSS	9  g ! , (       d  f       N-= f)
Ngenderrr   FrV   rz   r   r!   )r"   r!   axes_numlayout)	r   r[   r\   rs   r   r]   r	   r;   r   r<   r   groupedrz   s       r   r`   .TestDataFrameGroupByPlots.test_boxplot_legacy1  sW    //X/.''eL$W__&ID M$t{{+aG MLs   A%%
A3c                 b    UR                  SS9n[        UR                  SSS9n[        USSS9  g )	NrI  rr   Frz   ry   rC   r"   r   rJ  )r   r   r]   r	   rM  s       r    test_boxplot_legacy1_return_type:TestDataFrameGroupByPlots.test_boxplot_legacy1_return_type  s0    //X/. 5fU$6:r   c                    [        [        R                  S S [        S5      5      n[	        [
        R                  R                  S5      R                  S5      [        R                  " U5      S9nUR                  SS9n[        R                  " [        SS9   [        UR                  S	S
9nS S S 5        [!        [#        WR$                  5      SSS9  g ! , (       d  f       N-= f)Nr,   r!   r,   r#   r'   r"   levelFrV   rz   r   )rO   r#   rJ  )ziprY   rZ   ranger   r/   r0   r1   r   from_tuplesr   r[   r\   rs   r   r]   r	   r;   r   r<   tuplesr?   rN  rz   s        r   ru   .TestDataFrameGroupByPlots.test_boxplot_legacy2  s    V))#2.b	:II!!!$++G4((0
 **1*%''eL$W__&ID M$t{{+bH MLs   C
C#c                 B   [        [        R                  S S [        S5      5      n[	        [
        R                  R                  S5      R                  S5      [        R                  " U5      S9nUR                  SS9n[        UR                  SSS	9n[        USS
S9  g )Nr,   r!   rU  r'   r"   rV  Frz   rQ  r   rJ  )rX  rY   rZ   rY  r   r/   r0   r1   r   rZ  r   r   r]   r	   r[  s        r    test_boxplot_legacy2_return_type:TestDataFrameGroupByPlots.test_boxplot_legacy2_return_type  s    V))#2.b	:II!!!$++G4((0
 **1*% 5fU$6:r   z subplots, warn, axes_num, layoutTr#   r!   r!   )FNr"   r   c                 $   [        [        R                  S S [        S5      5      n[	        [
        R                  R                  S5      R                  S5      [        R                  " U5      S9nSn[        R                  " [        US9   UR                  SS9R                  S	SS
9nS S S 5        [        R                  " USS9   [        WR                   USS9n	S S S 5        [#        W	X4S9  g ! , (       d  f       NL= f! , (       d  f       N*= f)Nr,   r!   rU  r'   z+DataFrame.groupby with axis=1 is deprecatedr   r"   rV  r   )rW  axisFrV   rz   rQ  rJ  )rX  rY   rZ   rY  r   r/   r0   r1   r   rZ  r[   r\   FutureWarningunstackr   r   r]   r	   )
r<   ry   r_   rK  rL  r\  r?   r   rN  rz   s
             r   test_boxplot_legacy3.TestDataFrameGroupByPlots.test_boxplot_legacy3  s    
 V))#2.b	:II!!!$++G4((0
 <''SAjjqj)111BG B''uE$(D F 	$A BAEEs   C0D0
C>
Dc                    Sn[        [        R                  R                  S5      R	                  SSUS95      n[        [        R                  R                  S5      R	                  SSUS95      n[        R                  R                  S5      R                  SS/US9n[        X2US	.5      nUR                  S
5      nUR                  5       n[        [        R                  R                  5       5      S:X  d   e[        U5      S:X  d   e[        R                  S5        UR                  SS9n[        [        R                  R                  5       5      S:X  d   e[        U5      S:X  d   eg )Nr,   r!      r   r&  <   malefemaler   r   rI  rI  allrz   r   r"   )r   r/   r0   r1   normalr2   r   r   r4   r   rx   r.   get_fignumsr=   r,  r]   )r<   r>   r   r   rI  r?   gbress           r   test_grouped_plot_fignums3TestDataFrameGroupByPlots.test_grouped_plot_fignums  s*   		--a077Ra7HI		--a077BQ7GH&&q)00&(1C!0L&fMNZZ!ggi3::))+,1113x1}}		%jjVj,3::))+,1113x1}}r   c                    Sn[        [        R                  R                  S5      R	                  SSUS95      n[        [        R                  R                  S5      R	                  SSUS95      n[        R                  R                  S5      R                  SS/US9n[        X2US	.5      nUR                  S
5      R                  5         g )Nr,   r!   ri  r   r&  rj  rk  rl  rm  rI  )	r   r/   r0   r1   ro  r2   r   r   hist)r<   r>   r   r   rI  r?   s         r   &test_grouped_plot_fignums_excluded_col@TestDataFrameGroupByPlots.test_grouped_plot_fignums_excluded_col  s    		--a077Ra7HI		--a077BQ7GH&&q)00&(1C!0L&fMN


8!!#r   c                     UnUR                  SS9n[        U[        R                  5      (       d   e[	        US / SQS9  g )NrI  rr   r   r   r   expected_keys)r]   r   r/   ndarrayr
   r<   r   r?   r   s       r   test_grouped_box_return_type6TestDataFrameGroupByPlots.test_grouped_box_return_type  s@     x(&"**----D(H	
r   c                 ^    UnUR                  S5      R                  SS9n[        USSS/S9  g )NrI  rD   r   MaleFemaler{  r   r]   r
   r~  s       r   $test_grouped_box_return_type_groupby>TestDataFrameGroupByPlots.test_grouped_box_return_type_groupby  s4    H%--&-Avvfh=OPr   rC   r   c                     UnUR                  S5      R                  US9n[        XB/ SQS9  UR                  SUS9n[        XB/ SQS9  g )N	classroomr   rn   ro   r   r{  rI   rC   rz  r  )r<   r   rC   r?   returneds        r    test_grouped_box_return_type_arg:TestDataFrameGroupByPlots.test_grouped_box_return_type_arg  sO     ::k*22{2KxOT::+:F1Q	
r   c                 D   SR                  5       n[        [        R                  R	                  S5      R                  S5      US9nSR                  5       nUS-  US'   UR                  S5      R                  US9n[        XQUS	9  UR                  SUS
9n[        XQUS	9  g )Nz	X B C D Ar!   )rN   r   rl   zA Br#   r   r   r{  r  )	splitr   r/   r0   r1   rX   r   r]   r
   )r<   rC   columns2r/  categories2r  s         r   .test_grouped_box_return_type_arg_duplcate_catsHTestDataFrameGroupByPlots.test_grouped_box_return_type_arg_duplcate_cats  s     $$&II!!!$44V<h
 kkm%/J;;z*22{2KxKP;;*+;FxHMr   c                     UnSn[         R                  " [        US9   UR                  SS/UR                  SS9  S S S 5        g ! , (       d  f       g = f)Nz1Layout of 1x1 must be larger than required size 2r   r   r   r   rE   rI   rL  r   r   r   r]   rI  r<   r   r?   r   s       r   !test_grouped_box_layout_too_small;TestDataFrameGroupByPlots.test_grouped_box_layout_too_small	  sA    A]]:S1JJx2ryyJP 211   A
Ac                     UnSn[         R                  " [        US9   UR                  / SQSSS9  S S S 5        g ! , (       d  f       g = f)Nz7The 'layout' keyword is not supported when 'by' is Noner   rz  )r!   r"   rD   rE   rL  rC   )r   r   r   r]   r  s       r    test_grouped_box_layout_needs_by:TestDataFrameGroupByPlots.test_grouped_box_layout_needs_by  s@    G]]:S1JJ7"   211s	   ;
A	c                     UnSn[         R                  " [        US9   UR                  SS/UR                  SS9  S S S 5        g ! , (       d  f       g = f)Nz1At least one dimension of layout must be positiver   r   r   )r  r  r  r  s       r   'test_grouped_box_layout_positive_layoutATestDataFrameGroupByPlots.test_grouped_box_layout_positive_layout  sA    A]]:S1JJx2ryyJR 211r  zgb_key, axes_num, rows)rI  r!   r"   )r   rO   r!   )r  r#   r!   c                    Un[         R                  " [        SS9   [        UR	                  U5      R
                  SSS9  S S S 5        [        [        R                  R                  5       R                  X4S4S9  g ! , (       d  f       NA= f)NFrV   r   rD   rE   rC   r!   rJ  r[   r\   rs   r   r   r]   r	   rx   r.   gcfrz   )r<   r   gb_keyrK  rowsr?   s         r   ,test_grouped_box_layout_positive_layout_axesFTestDataFrameGroupByPlots.test_grouped_box_layout_positive_layout_axes#  si     ''eL

6"**8 M 	#**..*//(RS9U	 MLs   %A<<
B
zcol, visibler   Fr   r   c                    UnUR                  / SQSSS9n[        [        R                  R	                  5       R
                  SSS9  XR   n[        UR                  5       US9  [        UR                  R                  5       /US9  g )	Nrz  rI  rz   )rE   rI   rC   r#   ra  rJ  )visible)
r]   r	   rx   r.   r  rz   r   r5   xaxis	get_label)r<   r   r   r  r?   rz   r   s          r   test_grouped_box_layout_visible9TestDataFrameGroupByPlots.test_grouped_box_layout_visible3  sv    
 zz3f  
 	#**..*//!FKYr))+W=**,-w?r   c                     UnUR                  S5      R                  / SQSS9  [        [        R                  R                  5       R                  SSS9  g )Nr  rz  rD   r  r#   ra  rJ  r   r]   r	   rx   r.   r  rz   )r<   r   r?   s      r   test_grouped_box_layout_shape7TestDataFrameGroupByPlots.test_grouped_box_layout_shapeB  sG    


;''3 	( 	
 	#**..*//!FKr   colsr!   r  c                    Un[         R                  " [        SS9   [        UR	                  S5      R
                  SSU4SS9  S S S 5        [        [        R                  R                  5       R                  SS	S
9  g ! , (       d  f       N@= f)NFrV   r   r   r#   rD   r  rO   )r#   r!   rJ  r  )r<   r   r  r?   s       r   test_grouped_box_layout_works7TestDataFrameGroupByPlots.test_grouped_box_layout_worksJ  so     ''eL

:&..4y"	 M 	#**..*//!FK MLs   (A>>
Bz	rows, resrO   c                     UnUR                  / SQSUS4S9  [        [        R                  R	                  5       R
                  SUS4S9  g )Nrz  rI  r"   r  r#   rJ  )r]   r	   rx   r.   r  rz   )r<   r   r  rr  r?   s        r   'test_grouped_box_layout_axes_shape_rowsATestDataFrameGroupByPlots.test_grouped_box_layout_axes_shape_rowsW  sI     


3$PQ 	 	
 	#**..*//!S!HMr   z	cols, resc                     UnUR                  S5      R                  / SQSU4SS9  [        [        R                  R                  5       R                  SSU4S9  g )Nr  rz  r"   rD   r  r#   rJ  r  )r<   r   r  rr  r?   s        r   /test_grouped_box_layout_axes_shape_cols_groupbyITestDataFrameGroupByPlots.test_grouped_box_layout_axes_shape_cols_groupby`  sU     


;''3t9 	( 	

 	#**..*//!QHMr   c                 V   Un[         R                  " [        5         [        R                  R                  SS5      u  p4UR                  S5      R                  SSUS9  [        [        R                  R                  5       R                  SSS9  S S S 5        g ! , (       d  f       g = f)	Nr!   r   r   rz   rE   rC   r   rO   ra  rJ  )r[   r\   rs   rx   r.   ry   r   r]   r	   r  rz   )r<   r   r?   r{   rz   s        r   test_grouped_box_multiple_axes8TestDataFrameGroupByPlots.test_grouped_box_multiple_axesk  sy      ''4jj))!Q/GAJJz"**(SW*Xcjjnn.33aO 544s   A4B
B(c                    Un[         R                  R                  SS5      u  p4[        R                  " [
        5         UR                  / SQSSUS   S9nS S S 5        [        R                  " [        WR                  5      5      n[        USSS	9  [        R                  " XTS   5        US   R                  UL d   e[        R                  " [
        5         UR                  S
5      R                  / SQSUS   S9nS S S 5        [        R                  " [        UR                  5      5      n[        USSS	9  [        R                  " XTS   5        US   R                  UL d   eg ! , (       d  f       GN= f! , (       d  f       N= f)Nr!   r#   rz  rI  rz   r   )rE   rI   rC   r   )r"   r#   rJ  r  r"   r  )rx   r.   ry   r[   r\   rs   r]   r/   arrayr;   r   r	   assert_numpy_array_equalr   r   )r<   r   r?   r   rz   r  s         r   %test_grouped_box_multiple_axes_on_fig?TestDataFrameGroupByPlots.test_grouped_box_multiple_axes_on_figz  sH    JJ''1-	''4zz7"7	 " H 5 88D12(Qv>
##H1g6{!!S((( ''4zz+.667VPTUVPW 7 H 5 88D12(Qv>
##H1g6{!!S((() 54 54s   E*&E<*
E9<
F
c                 Z   UnSn[         R                  " [        US9   [        R                  R                  SS5      u  pE[        R                  " [        5         UR                  S5      R                  US9nS S S 5        S S S 5        g ! , (       d  f       N= f! , (       d  f       g = f)Nz@The number of passed axes must be 3, the same as the output plotr   r!   r#   r  )r   )r   r   r   rx   r.   ry   r[   r\   rs   r   r]   )r<   r   r?   r   r   rz   s         r   'test_grouped_box_multiple_axes_ax_errorATestDataFrameGroupByPlots.test_grouped_box_multiple_axes_ax_error  s}     P]]:S1

++Aq1IC++K8zz+.66$6? 9 21 98 21s#   =BB:B
B	B
B*c                 \    [        / SQ/ SQS.5      n[        UR                  SSSS9SSS9  g )	Nr   )r   r   r   r"   r"   r"   )r   r   r   r   r   )rI   r   r   r   rt   s     r   r   'TestDataFrameGroupByPlots.test_fontsize  s1    /6HIJJJssRJ0RB	
r   zcol, expected_xticklabelr   )(a, v)(b, v)(c, v)(d, v)(e, v)v1)(a, v1)(b, v1)(c, v1)(d, v1)(e, v1))
r  r  r  r  r  r  r  r  r  r  Nc                    [        [        R                  R                  S5      R	                  [        S5      S5      [        R                  R                  S5      R                  S5      [        R                  R                  S5      R                  S5      S.5      nUR                  S5      n[        UR                  SUSS9nUR                  5        Vs/ s H  ofR                  5       PM     nnX':X  d   eg s  snf )	Nr!   abcder   )catr   r  r  Frz   )ry   rE   rC   )r   r/   r0   r1   r2   r;   r   r   r]   r5   r7   )r<   r   expected_xticklabelr?   rN  rz   r@   result_xticklabels           r   #test_groupby_boxplot_subplots_false=TestDataFrameGroupByPlots.test_groupby_boxplot_subplots_false  s    P yy,,Q/66tG}cJYY**1-44S9ii++A.55c:
 **U# OOeCV
 483G3G3IJ3IaZZ\3IJ"777 Ks   C:c                     UR                  S5      nUR                  S5      nSn[        R                  " [        US9   [        UR                  SS9  S S S 5        g ! , (       d  f       g = f)NobjectrI  z:boxplot method requires numerical columns, nothing to plotr   F)ry   )r   r   r   r   r   r   r]   )r<   r   r?   rN  r   s        r   test_groupby_boxplot_object5TestDataFrameGroupByPlots.test_groupby_boxplot_object  sK    ^^H%**X&J]]:S1goo> 211s   A
A*c                    / SQ/ SQ/n[        [        U6 5      n[        R                  " USS/S9n[	        [
        R                  R                  S5      R                  S5      / SQUS	9nS
S/n[        UR                  USS9nSS/nUR                  5        Vs/ s H  oR                  5       PM     n	nXy:X  d   eg s  snf )N)r)   r)   bazr  rU   rU   quxr  )rF   rG   rF   rG   rF   rG   rF   rG   firstsecond)namesr!   )r#   r   r  rS   )r)   rF   )r)   rG   rz   r  z
(bar, one)z
(bar, two))r;   rX  r   rZ  r   r/   r0   r1   rX   r   r]   r5   r7   )
r<   arraysr\  r(   r?   r   rz   r  r@   r  s
             r   test_boxplot_multiindex_column8TestDataFrameGroupByPlots.test_boxplot_multiindex_column  s     ED
 c6l#&&vgx5HIII!!!$44V<!
 ~. CVL+\:373G3G3IJ3IaZZ\3IJ"777 Ks   B<r  )%r>  r?  r@  rA  r`   rR  r   rB  rC  ru   r_  rD  rs   rf  rs  rw  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r   r  r  r  rE  r  r   r   rG  rG    s   H;
 [[	I 	I [[; ; [[*
Q	')ABB	B"$ [[
 
 [[Q Q [[[[],DE	
 F 	
 [[[[],DEN F N [[Q Q [[  [[S S [[[[ 	-/BC	V	 
	V [[[[(E*Xt,<z4>PQ	@ 	@ [[L L [[[[VaW-	L . 	L [[[[[Aq6B7*;<N = N [[[[[Aq6B7*;<N = N [[P P [[) )4 [[@ @
 [["DEUFGJKd  '"	
%L8M%L8$?8r   rG  )__doc__r   rY   numpyr/   r   pandasr   r   r   r   r   r   pandas._testing_testingr[   pandas.tests.plotting.commonr	   r
   r   r   r   pandas.io.formats.printingr   importorskiprx   r=   r   r   rG  r  r   r   <module>r     sq    &        4,'-.a aHo8 o8r   