+
    NV-jæ  ã                  ó®   € ^ RI Ht ^ RIHt ^ RIt^ RIHt ^ RIH	t	H
t
 ^ RIHt ]'       d   ^ RIHt ^ RIHt ^ R	IHtHt RR
 R lltR R ltR R ltR# )é    )Úannotations)ÚTYPE_CHECKINGN)Úremove_na_arraylike)Ú
MultiIndexÚconcat)Úunpack_single_str_list)ÚHashable)Ú
IndexLabel)Ú	DataFrameÚSeriesc               ó$   € V ^8„  d   QhRRRRRR/# )é   Údatar   ÚkindÚstrÚreturnz"dict[Hashable, DataFrame | Series]© )Úformats   "Út/Volumes/fast/ai/experiments/ui-tars-smoke/.venv/lib/python3.14/site-packages/pandas/plotting/_matplotlib/groupby.pyÚ__annotate__r      s$   € ÷ 9ñ 9Ø
ð9Øð9à'ñ9ó    c           	     ó   € VR8X  d   ^ pM^p\        V P                  \        4      '       g   Q hV P                  P                  V,           Uu/ uF4  pW0P                  RV P                  P                  V4      V8H  3,          bK6  	  up# u upi )aí  
Create data for iteration given `by` is assigned or not, and it is only
used in both hist and boxplot.

If `by` is assigned, return a dictionary of DataFrames in which the key of
dictionary is the values in groups.
If `by` is not assigned, return input as is, and this preserves current
status of iter_data.

Parameters
----------
data : reformatted grouped data from `_compute_plot_data` method.
kind : str, plot kind. This function is only used for `hist` and `box` plots.

Returns
-------
iter_data : DataFrame or Dictionary of DataFrames

Examples
--------
If `by` is assigned:

>>> import numpy as np
>>> tuples = [("h1", "a"), ("h1", "b"), ("h2", "a"), ("h2", "b")]
>>> mi = pd.MultiIndex.from_tuples(tuples)
>>> value = [[1, 3, np.nan, np.nan], [3, 4, np.nan, np.nan], [np.nan, np.nan, 5, 6]]
>>> data = pd.DataFrame(value, columns=mi)
>>> create_iter_data_given_by(data)
{'h1':     h1
     a    b
0  1.0  3.0
1  3.0  4.0
2  NaN  NaN, 'h2':     h2
     a    b
0  NaN  NaN
1  NaN  NaN
2  5.0  6.0}
Úhist:NNN)Ú
isinstanceÚcolumnsr   ÚlevelsÚlocÚget_level_values)r   r   ÚlevelÚcols   &&  r   Úcreate_iter_data_given_byr!      sŠ   € ð\ ˆv„~Ø‰àˆô �d—l‘l¤J×/Ò/Ð/Ð/ð —<‘<×&Ñ& uÖ-óá-ˆCð 	�X‰X�a˜Ÿ™×6Ñ6°uÓ=ÀÑDÐDÕEÒEÙ-ñð ùò s   Á:Bc               ó(   € V ^8„  d   QhRRRRRRRR/# )r   r   r   Úbyr
   Úcolsr   r   )r   s   "r   r   r   W   s,   € ÷ +ñ +Ø
ð+Ø#ð+Ø+5ð+àñ+r   c                óâ   € \        V4      pV P                  V4      p. pV F=  w  rg\        P                  ! V.V.4      pWr,          p	W‰n        VP                  V	4       K?  	  \        V^R7      p V # )a  
Internal function to group data, and reassign multiindex column names onto the
result in order to let grouped data be used in _compute_plot_data method.

Parameters
----------
data : Original DataFrame to plot
by : grouped `by` parameter selected by users
cols : columns of data set (excluding columns used in `by`)

Returns
-------
Output is the reconstructed DataFrame with MultiIndex columns. The first level
of MI is unique values of groups, and second level of MI is the columns
selected by users.

Examples
--------
>>> d = {"h": ["h1", "h1", "h2"], "a": [1, 3, 5], "b": [3, 4, 6]}
>>> df = pd.DataFrame(d)
>>> reconstruct_data_with_by(df, by="h", cols=["a", "b"])
   h1      h2
   a     b     a     b
0  1.0   3.0   NaN   NaN
1  3.0   4.0   NaN   NaN
2  NaN   NaN   5.0   6.0
)Úaxis)r   Úgroupbyr   Úfrom_productr   Úappendr   )
r   r#   r$   Úby_modifiedÚgroupedÚ	data_listÚkeyÚgroupr   Ú	sub_groups
   &&&       r   Úreconstruct_data_with_byr0   W   ss   € ô< )¨Ó,€KØ�l‰l˜;Ó'€Gà€IÛ‰
ˆô ×)Ò)¨C¨5°$¨-Ó8ˆØ•Kˆ	Ø#ÔØ×Ñ˜Ö#ñ ô �) !Ô$€DØ€Kr   c               ó$   € V ^8„  d   QhRRRRRR/# )r   Úyz
np.ndarrayr#   zIndexLabel | Noner   r   )r   s   "r   r   r   …   s"   € ÷ "ñ " 
ð "Ð0Að "Àjñ "r   c                óä   € Ve^   \        V P                  4      ^8”  dD   \        P                  ! V P                   Uu. uF  p\        V4      NK  	  up4      P                  # \        V 4      # u upi )zÔInternal function to reformat y given `by` is applied or not for hist plot.

If by is None, input y is 1-d with NaN removed; and if by is not None, groupby
will take place and input y is multi-dimensional array.
)ÚlenÚshapeÚnpÚarrayÚTr   )r2   r#   r    s   && r   Úreformat_hist_y_given_byr9   …   sW   € ð 
‚~œ#˜aŸg™g›,¨Ô*Ü�xŠx¸Q¿SºSÓA¹S°cÔ,¨SÖ1¹SÑAÓB×DÑDÐDÜ˜qÓ!Ð!ùò Bs   ½A-)r   )Ú
__future__r   Útypingr   Únumpyr6   Úpandas.core.dtypes.missingr   Úpandasr   r   Ú pandas.plotting._matplotlib.miscr   Úcollections.abcr	   Úpandas._typingr
   r   r   r!   r0   r9   r   r   r   Ú<module>rB      s;   ðÝ "å  ã å :÷õ
 DçÝ(å)÷÷9õx+÷\"r   