+
    xȇiF                   `  a  0 t $ R t^ RIHt ^ RIHtHtHtHtH	t	 ^ RI
Ht ^ RIHt ^ RIHt ^ RIHt ^ RIHt ^ RIt^ RIt^ R	IHt ^ R
IHtHtHtHt ^ RIt^ RIH t H!t! ^ RI"H#t# ^ RI$H%t% ^ RI&H't'H(t(H)t) ^ RI*H+t+ ^ RI,H-t- ^ RI.H/t/H0t0H1t1H2t2H3t3H4t4 ^ RI5H6t6H7t7H8t8 ^ RI9H:t:H;t; ^ RI<H=t=H>t>H?t?H@t@ ^ RIAHBtB ^ RICHDu HEtF ^ RIGHHtHHItIHJtJHKtK ^ RILHMtM ^ RINHOtO ^ RIPHQtQHRtR ^ RISHTtT ]'       d%   ^ RIUHVtVHWtWHXtXHYtYHZtZH[t[H\t\H]t]H^t^H_t_H`t`Hata ^ RIbHctcHdtd RteR]fR&   R_tgR thR]fR!&    ! R" R#4      tiR$ R% ltjR& R' ltk ! R( R)4      tl ! R* R+4      tmR`R, R- lltn]RaR. R/ ll4       toRbR0 R1 lltp ! R2 R34      tq ! R4 R5]q4      tr ! R6 R7]q4      ts ! R8 R9]q4      tt ! R: R;]q4      tuR< R= ltvR> R? ltwRcR@ RA lltxRdRB RC lltyRdRD RE lltz ! RF RG]t4      t{ ! RH RI]q4      t|ReRJ RK llt}RfRL RM llt~RgRN RO lltRP RQ ltRgRR RS lltRT RU lt ! RV RW4      t]-! RX4      RhRY RZ ll4       tRiR[ R\ lltR] R^ ltR# )jz
Internal module for formatting output data in csv, html, xml,
and latex files. This module also applies to display formatting.
)annotations)Callable	GeneratorHashableMappingSequence)contextmanager)
QUOTE_NONE)Decimal)partial)StringION)get_terminal_size)TYPE_CHECKINGAnyFinalcast)
get_option
set_option)lib)NA)NaT	Timedelta	Timestamp)NaTType)
set_module)is_complex_dtypeis_float
is_integeris_list_likeis_numeric_dtype	is_scalar)CategoricalDtypeDatetimeTZDtypeExtensionDtype)isnanotna)CategoricalDatetimeArrayExtensionArrayTimedeltaArray)PandasObject)Index
MultiIndexPeriodIndexensure_index)DatetimeIndex)TimedeltaIndex)check_parent_directorystringify_path)printing)	ArrayLikeAxesColspaceArgTypeColspaceTypeCompressionOptionsFilePathFloatFormatTypeFormattersType
IndexLabelSequenceNotStrStorageOptionsWriteBuffer)	DataFrameSeriesa	  
        Parameters
        ----------
        buf : str, Path or StringIO-like, optional, default None
            Buffer to write to. If None, the output is returned as a string.
        columns : array-like, optional, default None
            The subset of columns to write. Writes all columns by default.
        col_space : %(col_space_type)s, optional
            %(col_space)s
        header : %(header_type)s, optional
            %(header)s.
        index : bool, optional, default True
            Whether to print index (row) labels.
        na_rep : str, optional, default 'NaN'
            String representation of ``NaN`` to use.
        formatters : list, tuple or dict of one-param. functions, optional
            Formatter functions to apply to columns' elements by position or
            name.
            The result of each function must be a unicode string.
            List/tuple must be of length equal to the number of columns.
        float_format : one-parameter function, optional, default None
            Formatter function to apply to columns' elements if they are
            floats. This function must return a unicode string and will be
            applied only to the non-``NaN`` elements, with ``NaN`` being
            handled by ``na_rep``.
        sparsify : bool, optional, default True
            Set to False for a DataFrame with a hierarchical index to print
            every multiindex key at each row.
        index_names : bool, optional, default True
            Prints the names of the indexes.
        justify : str, default None
            How to justify the column labels. If None uses the option from
            the print configuration (controlled by set_option), 'right' out
            of the box. Valid values are

            * left
            * right
            * center
            * justify
            * justify-all
            * start
            * end
            * inherit
            * match-parent
            * initial
            * unset.
        max_rows : int, optional
            Maximum number of rows to display in the console.
        max_cols : int, optional
            Maximum number of columns to display in the console.
        show_dimensions : bool, default False
            Display DataFrame dimensions (number of rows by number of columns).
        decimal : str, default '.'
            Character recognized as decimal separator, e.g. ',' in Europe.
    r   common_docstringz
        Returns
        -------
        str or None
            If buf is None, returns the result as a string. Otherwise returns
            None.
    return_docstringc                  ~    ] tR t^tRtRRRRRRRRRR	R
RRRRRRR/	R R lltR R ltR R ltR R ltR R lt	Rt
R# )SeriesFormatterzP
Implement the main logic of Series.to_string, which underlies
Series.__repr__.
lengthTheaderindexna_repNaNnameFfloat_formatNdtypemax_rowsmin_rowsc               D    V ^8  d   QhRRRRRRRRRR	R
RRRRRRRRRRR/# )   seriesrA   rF   
bool | strrG   boolrH   rI   strrK   rL   
str | NonerM   rN   
int | NonerO   returnNone )formats   "h/Users/max/.openclaw/workspace/postharvest/venv/lib/python3.14/site-packages/pandas/io/formats/format.py__annotate__SeriesFormatter.__annotate__   sx       	
     !    
    c       	        	   Wn         \        4       V n        W`n        WPn        W0n        W n        W@n        Wn        Wn	        Vf   \        R4      pWpn        Wn        \        P                  ! 4       V n        V P!                  4        R # )Ndisplay.float_format)rR   r   bufrK   rI   rG   rF   rH   rN   rO   r   rL   rM   r3   get_adjustmentadj_chk_truncate)selfrR   rF   rG   rH   rI   rK   rL   rM   rN   rO   s   &&$$$$$$$$$r\   __init__SeriesFormatter.__init__   sm     :	
  %&<=L(
**,r_   c                   V ^8  d   QhRR/# rQ   rX   rY   rZ   )r[   s   "r\   r]   r^      s     ? ?t ?r_   c                	.   V  V P                   pV P                  pT;'       d    \        V P                  4      V8  pV P                  pV'       d   \	        \
        V4      pV'       d   \        W4      pV^8X  d   TpVP                  RV pMnV^,          p\        V4      p\        P                  ! \        P                  ! V4      \        P                  ! We,
          V4      .4      pVP                  V,          pWPn        MRV n        W@n        W0n        R# )   N)rO   rN   lenrR   r   intminilocnphstackarange
tr_row_num	tr_seriesis_truncated_vertically)rf   rO   rN   rv   rR   row_num_len_slices   &       r\   re   SeriesFormatter._chk_truncate   s    ==== #+"L"LDKK0@80K"C*H x21}"Yh/"a-6{YYw'4>4)HI  V,%O"DO'>$r_   c                   V ^8  d   QhRR/# rQ   rX   rU   rZ   )r[   s   "r\   r]   r^     s     ( (S (r_   c                	   V P                   P                  pR pV P                   P                  p\        V\        \
        \        34      '       d%   VP                  e   VRVP                   2,          pV P                  RJd:   Ve6   V'       d
   VR,          p\        P                  ! VRR7      pVRV 2,          pV P                  RJ g$   V P                  R	8X  dC   V P                  '       d1   V'       d
   VR,          pVR
\        V P                   4       2,          pV P                  RJdi   V P                  e[   \        V P                   P                  RR4      pV'       d2   V'       d
   VR,          pVR\        P                  ! V4       2,          p\        V P                   P                  \"        4      '       d>   V P                   P$                  P'                  4       pV'       d
   VR,          pW&,          p\)        V4      # ) NzFreq: Fz, 
)escape_charszName: TtruncatezLength: rK   zdtype: 	r   )rR   rK   rH   
isinstancer/   r-   r0   freqfreqstrr3   pprint_thingrF   rv   rm   rM   getattrru   r!   _values_get_repr_footerrU   )rf   rK   footerrH   series_name
dtype_name
level_infos   &      r\   _get_footerSeriesFormatter._get_footer  s   {{!!u}k>JKK

&u}}o..F99E!d&6$"//CUVK{m,,F;;$KK:%$*F*F*F$T[[!1 233F::U"tzz'= !5!5vtDJdNFGH$9$9*$E#FGG dnn**,<==//@@BJ$ F6{r_   c                   V ^8  d   QhRR/# rQ   rX   	list[str]rZ   )r[   s   "r\   r]   r^   ,  s     
 
y 
r_   c                	    \        V P                  P                  R V P                  V P                  V P
                  R7      # )N)rL   rI   leading_space)format_arrayru   r   rL   rI   rH   rf   s   &r\   _get_formatted_values%SeriesFormatter._get_formatted_values,  s6    NN""**;;**
 	
r_   c                   V ^8  d   QhRR/# r|   rZ   )r[   s   "r\   r]   r^   5  s     +$ +$3 +$r_   c                	   V P                   pV P                  4       p\        V4      ^ 8X  d&   \        V P                  4      P
                   RV R2# VP                  p\        V4      p\        V\        4      '       dM   VP                  RRR7      p\        P                  ! 4       pVP                  ! ^.VO5!  P                  R4      pMVP                  RR7      pV P!                  4       pV P"                  '       d   ^ pV P$                  p	\'        \(        V	4      p	V P*                  P                  Wy^,
          ,          4      p
V
^8  d   RpMR	pV P*                  P-                  V.V
R
R7      ^ ,          pVP/                  W,           V4       VP/                  V	^,           R4       V P                  '       d)   V P*                  P                  ! ^.VR,          V.O5!  pMV P*                  P                  ^V4      pV P0                  '       d    V'       d   V^ ,          R,           V,           pV'       d   VRV,           ,          p\3        RP5                  V4      4      # )    z([], )TN)include_namessparsifyr   include_name...z..centermoder~   rl   NN)ru   r   rm   typerR   __name__rH   
_has_namesr   r,   _format_multir3   rc   adjoinsplit_format_flatr   rv   rt   r   rn   rd   justifyinsertrG   rU   join)rf   rR   r   rH   have_header	fmt_indexrd   
fmt_valuesn_header_rowsrw   widthdot_strresults   &            r\   	to_stringSeriesFormatter.to_string5  s   !!#v;!4;;'001vha@@ 'eZ((++$+NI))+C

11y177=I***=I//1
'''MooG3(GHHLLaK!89Eqy hh&&y%h&GJGg5w?Wq["-:::XX__QE)B-)DEFXX__Q
3F;;;;q\D(61FdVm#F2776?##r_   )rd   rb   rM   rL   rG   rH   rv   rF   rN   rO   rI   rK   rR   rt   ru   )r   
__module____qualname____firstlineno____doc__rg   re   r   r   r   __static_attributes__rZ   r_   r\   rE   rE      s    
 "	
     $(   $  $@?>(T
+$ +$r_   rE   c                   V ^8  d   QhRR/# rQ   rX   zdict[str, Any]rZ   )r[   s   "r\   r]   r]   c  s      > r_   c                     ^ RI Hp  \        R4      '       d   V P                  4       w  rMRpR\        R4      R\        R4      R\        R	4      R
\        R4      R\        R4      RV/# )a  Get the parameters used to repr(dataFrame) calls using DataFrame.to_string.

Supplying these parameters to DataFrame.to_string is equivalent to calling
``repr(DataFrame)``. This is useful if you want to adjust the repr output.

Example
-------
>>> import pandas as pd
>>>
>>> df = pd.DataFrame([[1, 2], [3, 4]])
>>> repr_params = pd.io.formats.format.get_dataframe_repr_params()
>>> repr(df) == df.to_string(**repr_params)
True
)consolezdisplay.expand_frame_reprNrN   display.max_rowsrO   display.min_rowsmax_colszdisplay.max_columnsmax_colwidthdisplay.max_colwidthshow_dimensionsdisplay.show_dimensions
line_width)pandas.io.formatsr   r   get_console_size)r   r   _s      r\   get_dataframe_repr_paramsr   c  sp     *-..002
A
J12J12J45
#9::&?@j r_   c                   V ^8  d   QhRR/# r   rZ   )r[   s   "r\   r]   r]     s       r_   c                     \        4       w  r\        R4      pV^ 8X  d   TMTpV^ 8X  d   TM
\        R4      pRRRRRVRVR\        R	4      /# )
a  Get the parameters used to repr(Series) calls using Series.to_string.

Supplying these parameters to Series.to_string is equivalent to calling
``repr(series)``. This is useful if you want to adjust the series repr output.

Example
-------
>>> import pandas as pd
>>>
>>> ser = pd.Series([1, 2, 3, 4])
>>> repr_params = pd.io.formats.format.get_series_repr_params()
>>> repr(ser) == ser.to_string(**repr_params)
True
r   r   rK   TrM   rO   rN   rF   r   )r   r   )r   heightmax_rows_optrN   rO   s        r\   get_series_repr_paramsr     sf     &'ME01L%*vH%*v
;M0NH 	HH*67 r_   c                  R   ] tR tRtRt]'       d   ]MRt]]],           ,          tRJR R lltR R lt]	R	 R
 l4       t
]	R R l4       t]	R R l4       t]	R R l4       t]	R R l4       t]	R R l4       t]	R R l4       t]	R R l4       t]	R R l4       t]	R R l4       tR R ltR R  ltR! R" ltR# R$ ltR% R& ltR' R( ltR) R* ltR+ R, ltR- R. ltR/ R0 ltR1 R2 ltR3 R4 ltR5 R6 lt R7 R8 lt!R9 R: lt"R; R< lt#R= R> lt$R? R@ lt%RA RB lt&RC RD lt'RE RF lt(RG RH lt)RIt*R# )KDataFrameFormatteri  z{
Class for processing dataframe formatting options and data.

Used by DataFrame.to_string, which backs DataFrame.__repr__.
r~   Nc          &     d    V ^8  d   QhRRRRRRRRR	R
RRRRRRRRRRRR
RRRRRRRRRRRR
RR
RR /# )!rQ   framer@   columnsAxes | None	col_spaceColspaceArgType | NonerG   zbool | SequenceNotStr[str]rH   rT   rI   rU   
formattersFormattersType | Noner   rV   rL   FloatFormatType | Noner   bool | Noneindex_namesrN   rW   rO   r   r   rS   decimal	bold_rowsescaperX   rY   rZ   )r[   s   "r\   r]   DataFrameFormatter.__annotate__  s     -- ---- -- *	--
 +-- -- -- *-- -- --- -- -- -- -- --  $!--" #--$ %--& '--( 
)--r_   c                	n   Wn         V P                  V4      V n        V P                  V4      V n        W@n        WPn        W`n        V P                  V4      V n	        V P                  V4      V n        V P                  V	4      V n        V P                  V
4      V n        Wn        VV n        VV n        VV n        Wn        Wn        Wn        Wn        V P1                  4       V n        V P5                  4       V n        V P                   V n        V P;                  4        \<        P>                  ! 4       V n         R # N)!r   _initialize_columnsr   _initialize_colspacer   rG   rH   rI   _initialize_formattersr   _initialize_justifyr   _validate_float_formatrL   _initialize_sparsifyr   show_index_namesr   r   r   rN   rO   r   r   _calc_max_cols_fittedmax_cols_fitted_calc_max_rows_fittedmax_rows_fittedtr_framer   r3   rc   rd   )rf   r   r   r   rG   rH   rI   r   r   rL   r   r   rN   rO   r   r   r   r   r   s   &&&&&&&&&&&&&&&&&&&r\   rg   DataFrameFormatter.__init__  s    * 
//8229=
55jA//8 77E11(; +"   .#99;#99;

**,r_   c                   V ^8  d   QhRR/# rQ   rX   list[list[str]]rZ   )r[   s   "r\   r]   r     s     
 
_ 
r_   c                    V P                  4       pV P                  '       d.   V P                  V P                  4      pVP	                  ^ V4       V# )z@
Render a DataFrame to a list of columns (as lists of strings).
)_get_strcols_without_indexrH   _get_formatted_indexr   r   )rf   strcols	str_indexs   &  r\   get_strcolsDataFrameFormatter.get_strcols  sB     113:::11$--@INN1i(r_   c                   V ^8  d   QhRR/# rQ   rX   rT   rZ   )r[   s   "r\   r]   r     s     
 
 
r_   c                	t    V P                   R J ;'       g$    V P                   R8H  ;'       d    V P                  # )Tr   )r   is_truncatedr   s   &r\   should_show_dimensions)DataFrameFormatter.should_show_dimensions  s;    ##t+ 
 
  J.DD43D3D	
r_   c                   V ^8  d   QhRR/# r   rZ   )r[   s   "r\   r]   r     s     T Td Tr_   c                	T    \        V P                  ;'       g    V P                  4      # r   )rT   is_truncated_horizontallyrv   r   s   &r\   r  DataFrameFormatter.is_truncated  s!    D22RRd6R6RSSr_   c                   V ^8  d   QhRR/# r   rZ   )r[   s   "r\   r]   r     s     Y Y4 Yr_   c                	    \        V P                  ;'       d#    \        V P                  4      V P                  8  4      # r   )rT   r   rm   r   r   s   &r\   r  ,DataFrameFormatter.is_truncated_horizontally  s/    D((WWc$,,.?$BVBV.VXXr_   c                   V ^8  d   QhRR/# r   rZ   )r[   s   "r\   r]   r     s     W W Wr_   c                	    \        V P                  ;'       d#    \        V P                  4      V P                  8  4      # r   )rT   r   rm   r   r   s   &r\   rv   *DataFrameFormatter.is_truncated_vertically  s.    D((UUc$**o@T@T.TVVr_   c                   V ^8  d   QhRR/# r|   rZ   )r[   s   "r\   r]   r     s     S S Sr_   c                	t    R \        V P                  4       R\        V P                  P                  4       R2# )z

[z rows x z	 columns])rm   r   r   r   s   &r\   dimensions_info"DataFrameFormatter.dimensions_info  s0    s4::'xDJJ4F4F0G/H	RRr_   c                   V ^8  d   QhRR/# r   rZ   )r[   s   "r\   r]   r     s     , , ,r_   c                	@    \        V P                  P                  4      # r   )r   r   rH   r   s   &r\   has_index_names"DataFrameFormatter.has_index_names  s    $****++r_   c                   V ^8  d   QhRR/# r   rZ   )r[   s   "r\   r]   r     s     . .$ .r_   c                	@    \        V P                  P                  4      # r   )r   r   r   r   s   &r\   has_column_names#DataFrameFormatter.has_column_names  s    $**,,--r_   c                   V ^8  d   QhRR/# r   rZ   )r[   s   "r\   r]   r     s     N ND Nr_   c                	Z    \        V P                  V P                  V P                  34      # r   )allr  rH   r   r   s   &r\   show_row_idx_names%DataFrameFormatter.show_row_idx_names  s$    D(($**d6K6KLMMr_   c                   V ^8  d   QhRR/# r   rZ   )r[   s   "r\   r]   r     s     P PD Pr_   c                	Z    \        V P                  V P                  V P                  34      # r   )r  r  r   rG   r   s   &r\   show_col_idx_names%DataFrameFormatter.show_col_idx_names  s$    D))4+@+@$++NOOr_   c                   V ^8  d   QhRR/# rQ   rX   rn   rZ   )r[   s   "r\   r]   r     s     F FC Fr_   c                	    \        V P                  ;'       g    \        V P                  4      \        V P                  4      4      # r   )ro   rN   rm   r   r   s   &r\   max_rows_displayed%DataFrameFormatter.max_rows_displayed
  s+    4==33C

OS_EEr_   c                    V ^8  d   QhRRRR/# )rQ   r   r   rX   rT   rZ   )r[   s   "r\   r]   r     s      [ T r_   c                	$    Vf   \        R4      # V# )Nzdisplay.multi_sparser   )rf   r   s   &&r\   r   'DataFrameFormatter._initialize_sparsify  s    455r_   c                    V ^8  d   QhRRRR/# )rQ   r   r   rX   r;   rZ   )r[   s   "r\   r]   r     s      /	r_   c                	   Vf   / # \        V P                  P                  4      \        V4      8X  g   \        V\        4      '       d   V# \        R\        V4       R\        V P                  P                  4       R24      h)NzFormatters length(+) should match DataFrame number of columns(r   )rm   r   r   r   dict
ValueError)rf   r   s   &&r\   r   )DataFrameFormatter._initialize_formatters  sx     I##$J7:jRV;W;W$S_$5 6//24::3E3E/F.GqJ r_   c                    V ^8  d   QhRRRR/# )rQ   r   rV   rX   rU   rZ   )r[   s   "r\   r]   r      s      : # r_   c                	$    Vf   \        R4      # V# )Nzdisplay.colheader_justifyr+  )rf   r   s   &&r\   r   &DataFrameFormatter._initialize_justify   s    ?9::Nr_   c                    V ^8  d   QhRRRR/# )rQ   r   r   rX   r+   rZ   )r[   s   "r\   r]   r   &  s     & &; &5 &r_   c                	    Ve&   \        V4      pV P                  V,          V n        V# V P                  P                  # r   )r.   r   r   )rf   r   colss   && r\   r   &DataFrameFormatter._initialize_columns&  s7    (DD)DJK::%%%r_   c                    V ^8  d   QhRRRR/# )rQ   r   r   rX   r7   rZ   )r[   s   "r\   r]   r   .  s      .D  r_   c                	   Vf   / pV# \        V\        \        34      '       d@   RV/pVP                  \        P                  V P                  P                  V4      4       V# \        V\        4      '       dM   VP                  4        F4  pW0P                  P                  9  g   K  VR8w  g   K(  \        RV 24      h	  TpV# \        V P                  P                  4      \        V4      8w  d9   \        R\        V4       R\        V P                  P                  4       R24      h\	        \        V P                  P                  VRR7      4      pV# )Nr~   z,Col_space is defined for an unknown column: zCol_space length(r/  r   Tstrict)r   rn   rU   updater0  fromkeysr   r   r   keysr1  rm   zip)rf   r   r   columns   &&  r\   r   'DataFrameFormatter._initialize_colspace.  s1    F$ # 	C:..)_FMM$--

(:(:IFG  	7++#..*!3!33"$FvhO  +
 F  4::%%&#i.8 'I'7 8336tzz7I7I3J2K1N  #djj00)DIJFr_   c                   V ^8  d   QhRR/# rQ   rX   rW   rZ   )r[   s   "r\   r]   r   F  s     	! 	!z 	!r_   c                    V P                  4       '       g   V P                  # \        4       w  rV P                  V4      '       d   V# V P                  # )z%Number of columns fitting the screen.)_is_in_terminalr   r   _is_screen_narrow)rf   r   r   s   &  r\   r   (DataFrameFormatter._calc_max_cols_fittedF  sE    ##%%== $&!!%((L== r_   c                   V ^8  d   QhRR/# rE  rZ   )r[   s   "r\   r]   r   Q  s     / /z /r_   c                   V P                  4       '       d[   \        4       w  rV P                  ^ 8X  d   W P                  4       ,
          # V P	                  V4      '       d   TpMV P                  pMV P                  pV P                  V4      # )z,Number of rows with data fitting the screen.)rG  r   rN   _get_number_of_auxiliary_rows_is_screen_short_adjust_max_rows)rf   r   r   rN   s   &   r\   r   (DataFrameFormatter._calc_max_rows_fittedQ  st     !!)+IA}}! B B DDD$$V,,!==}}H$$X..r_   c                    V ^8  d   QhRRRR/# )rQ   rN   rW   rX   rZ   )r[   s   "r\   r]   r   d  s       
 r_   c                    V'       dC   \        V P                  4      V8  d)   V P                  '       d   \        V P                  V4      pV# )zAdjust max_rows using display logic.

See description here:
https://pandas.pydata.org/docs/dev/user_guide/options.html#frequently-used-options

GH #37359
)rm   r   rO   ro   )rf   rN   s   &&r\   rN  #DataFrameFormatter._adjust_max_rowsd  s4     DJJ(*t}}h7r_   c                   V ^8  d   QhRR/# r   rZ   )r[   s   "r\   r]   r   r  s     > > >r_   c                `    \        V P                  ^ 8H  ;'       g    V P                  ^ 8H  4      # )z/Check if the output is to be shown in terminal.)rT   r   rN   r   s   &r\   rG  "DataFrameFormatter._is_in_terminalr  s'    DMMQ&<<$--1*<==r_   c                   V ^8  d   QhRR/# r   rZ   )r[   s   "r\   r]   r   v  s     P Pd Pr_   c                	    \        V P                  ^ 8H  ;'       d#    \        V P                  P                  4      V8  4      # r   )rT   r   rm   r   r   )rf   	max_widths   &&r\   rH  $DataFrameFormatter._is_screen_narrowv  s2    DMMQ&NN3tzz/A/A+BY+NOOr_   c                   V ^8  d   QhRR/# r   rZ   )r[   s   "r\   r]   r   y  s     I Id Ir_   c                	r    \        V P                  ^ 8H  ;'       d    \        V P                  4      V8  4      # rX  )rT   rN   rm   r   )rf   
max_heights   &&r\   rM  #DataFrameFormatter._is_screen_shorty  s+    DMMQ&GG3tzz?Z+GHHr_   c                   V ^8  d   QhRR/# r%  rZ   )r[   s   "r\   r]   r   |  s      s r_   c                    ^p^pW,           pV P                   '       d+   V\        V P                  P                  4       4      ,          pV P                  '       d
   V^,          pV# )z?Get number of rows occupied by prompt, dots and dimension info.)r   rm   r  
splitlinesrG   )rf   dot_row
prompt_rownum_rowss   &   r\   rL  0DataFrameFormatter._get_number_of_auxiliary_rows|  sU    
'D00;;=>>H;;;MHr_   c                   V ^8  d   QhRR/# rj   rZ   )r[   s   "r\   r]   r     s     ( ($ (r_   c                    V P                   '       d   V P                  4        V P                  '       d   V P                  4        R# R# )zI
Check whether the frame should be truncated. If so, slice the frame up.
N)r  _truncate_horizontallyrv   _truncate_verticallyr   s   &r\   r   DataFrameFormatter.truncate  s9     )))'')'''%%' (r_   c                   V ^8  d   QhRR/# rj   rZ   )r[   s   "r\   r]   r     s     ' ' 'r_   c                   V P                   f   Q hV P                   ^,          pV^8  d   \        V P                  P                  4      p\        P
                  ! \        P                  ! V4      \        P                  ! W!,
          V4      .4      pV P                  P                  RV3,          V n        \        V P                  \        \        34      '       d'   . V P                  RV OV P                  V) R OV n	        M@\        \        V P                  4      pV P                  P                  RRV13,          V n        Wn        R# )zRemove columns, which are not to be displayed and adjust formatters.

Attributes affected:
    - tr_frame
    - formatters
    - tr_col_num
NNNN)r   rm   r   r   rq   rr   rs   rp   r   r   listtupler   rn   r   
tr_col_num)rf   col_numrx   ry   s   &   r\   rh  )DataFrameFormatter._truncate_horizontally  s    ##///&&!+a<t}},,-DYY		' 2BIIdnd4STUF MM..q&y9DM $//D%=99#__Xg.#__gXY/#
 3.G MM..q(7({;DM&r_   c                   V ^8  d   QhRR/# rj   rZ   )r[   s   "r\   r]   r     s     " "d "r_   c                   V P                   f   Q hV P                   ^,          pV^8  d   \        V P                  4      p\        P                  ! \        P
                  ! V4      \        P
                  ! W!,
          V4      .4      pV P                  P                  V,          V n        M@\        \        V P                  4      pV P                  P                  RV1R3,          V n        Wn
        R# )zbRemove rows, which are not to be displayed.

Attributes affected:
    - tr_frame
    - tr_row_num
Nrm  )r   rm   r   rq   rr   rs   rp   r   rn   rN   rt   )rf   rw   rx   ry   s   &   r\   ri  'DataFrameFormatter._truncate_vertically  s     ##///&&!+a<t}}%DYY		' 2BIIdnd4STUF MM..v6DM3.G MM..xx{;DM!r_   c                   V ^8  d   QhRR/# r   rZ   )r[   s   "r\   r]   r     s     - -O -r_   c                	n  a  . p\        S P                  4      '       g   S P                  '       g   \        S P                  4       Fm  w  r#S P	                  V4      p\        VS P                  \        S P                  P                  V^ 4      4      S P                  R7      pVP                  V4       Ko  	  V# \        S P                  4      '       d   \        \        \        ,          S P                  4      S n        \        S P                  4      \        S P                   4      8w  d9   \#        R\        S P                   4       R\        S P                  4       R24      hS P                   Uu. uF  qU.NK  	  ppMS P%                  S P                  4      pS P&                  '       d   V F  pVP                  R4       K  	  \        S P                  4       F  w  r#Wb,          p\)        \        S P                  P                  V^ 4      4      .V 3R lV 4       O5!  p	S P	                  V4      p\        VS P                  V	S P                  R7      p\)        . V 3R lV 4       OV	N5!  p
S P                  P                  WS P                  R	7      pVP                  W,           4       K  	  V# u upi )
r   )stringsr   minimumrd   zWriting z cols but got z aliasesr~   c              3  Z   <"   T F   pSP                   P                  V4      x  K"  	  R # 5ir   rd   rm   .0xrf   s   & r\   	<genexpr>@DataFrameFormatter._get_strcols_without_index.<locals>.<genexpr>  s     0R'Qa'   (+)ry  rd   c              3  Z   <"   T F   pSP                   P                  V4      x  K"  	  R # 5ir   r{  r|  s   & r\   r  r    s     @ZDHHLLOOZr  r   )r   rG   	enumerater   
format_col_make_fixed_widthr   rn   r   getrd   appendr   rn  rU   rm   r   r1  _get_formatted_column_labelsr  max)rf   r   icr   labelstr_columnsr~  cheaderheader_colwidthmax_lens   f          r\   r   -DataFrameFormatter._get_strcols_without_index  s   #%DKK((!$--0!__Q/
.& LL 2 21a 89	
 z* 1 N$$tCy$++6DK4;;3t||#44 s4<<01 2"4;;/0:  15<u7K<K;;DMMJK"""  ! dmm,DA!nG!DNN&&q!,-0R'0RO +J*DLL/txxJ R@Z@R/RGhh&&wdll&KGNN7/0 - - =s   1J2c                    V ^8  d   QhRRRR/# )rQ   r  rn   rX   r   rZ   )r[   s   "r\   r]   r     s     
 
C 
I 
r_   c           
     	>   V P                   pV P                  V4      p\        VP                  R V3,          P                  VV P
                  V P                  V P                  P                  VP                  V,          4      V P                  V P                  R7      # )rm  )rL   rI   spacer   r   )r   _get_formatterr   rp   r   rL   rI   r   r  r   r   rH   )rf   r  r   	formatters   &&  r\   r  DataFrameFormatter.format_col  sz    ''*	JJq!t$$**;;..$$U]]1%56LL**
 	
r_   c                    V ^8  d   QhRRRR/# )rQ   r  	str | intrX   Callable | NonerZ   )r[   s   "r\   r]   r     s     
0 
0	 
0o 
0r_   c                	Z   \        V P                  \        \        34      '       d7   \	        V4      '       d$   \        \        V4      pV P                  V,          # R # \	        V4      '       d$   WP                  9  d   V P                  V,          pV P                  P                  VR 4      # r   )	r   r   rn  ro  r   r   rn   r   r  )rf   r  s   &&r\   r  !DataFrameFormatter._get_formatter  ss    dooe}55!}}aLq))!}},,!6LLO??&&q$//r_   c                    V ^8  d   QhRRRR/# )rQ   r   r@   rX   r   rZ   )r[   s   "r\   r]   r     s      )  r_   c                	@   ^ RI Hp VP                  p\        V\        4      '       dd   VP                  RRR7      pV P                  '       d   \        V4      '       d	   V! V4      p\        VRR/  Uu. uF  p\        V4      NK  	  ppV# VP                  RR7      p\        \        W@P                  P                  RR7      4       UUUu. uF<  w  pw  rXV P                  V4      '       g   \        V4      '       d
   RV,           MT.NK>  	  ppppV# u upi u upppi )	r   )sparsify_labelsF)r   r   r=  Tr   r<   )pandas.core.indexes.multir  r   r   r,   r   r   rm   rA  rn  r   r  r   dtypesr  r   )	rf   r   r  r   fmt_columnsr~  r  r  rM   s	   &&       r\   r  /DataFrameFormatter._get_formatted_column_labels  s   =--gz**!//e/TK}}}[!1!1-k:,/,JT,JK,Jq47,JKK  "..E.BK &/ZZ%6%6uE&	&MAz  ..q116Fu6M6M !G
&  	  L	s   4DADc                    V ^8  d   QhRRRR/# )rQ   r   r@   rX   r   rZ   )r[   s   "r\   r]   r   !  s     ' ') '	 'r_   c                	j   V P                   P                  4        UUu/ uF  w  r#V\        \        V4      bK  	  pppVP                  pVP
                  pV P                  R 4      p\        V\        4      '       d*   VP                  V P                  V P                  VR7      pMVP                  V P                  VR7      .pV U	u. uF>  p	\        \        \        V	4      RVP!                  R^ 4      V P"                  R7      4      NK@  	  pp	V P"                  P$                  ! ^.VO5!  P'                  R4      p
V P(                  '       d*   V P+                  4        U	u. uF  p	\-        V	4      NK  	  pp	MR.VP.                  ,          pV P0                  '       d	   W,           # V
# u uppi u up	i u up	i )	__index__)r   r   r  )r   r  leftr~   )r   ry  rd   r   )r   itemsr   rn   rH   r   r  r   r,   r   r   r  r   ro  r  rn  r  rd   r   r   r"  _get_column_name_listrU   nlevelsrG   )rf   r   kvr   rH   r   fmtr   r~  adjoined
col_headers   &&          r\   r   'DataFrameFormatter._get_formatted_index!  s    261E1E1GH1GQS!_1G	H--!!+.eZ((++"55 , I ""0G0GSV"WI 
  !GVY]]2q5Itxx
  	 
 88??11y177= """*.*D*D*FG*FQ#a&*FJGJ/J;;;((OI I 
 Hs   F%AF+F0c                   V ^8  d   QhRR/# )rQ   rX   zlist[Hashable]rZ   )r[   s   "r\   r]   r   J  s      ~ r_   c                	    . pV P                   P                  p\        V\        4      '       d%   VP	                  R  VP
                   4       4       V# TP                  VP                  f   RMVP                  4       V# )c              3  0   "   T F  qf   RMTx  K  	  R # 5i)Nr~   rZ   )r}  rK   s   & r\   r  ;DataFrameFormatter._get_column_name_list.<locals>.<genexpr>N  s     P-$|5-s   r~   )r   r   r   r,   extendnamesr  rK   )rf   r  r   s   &  r\   r  (DataFrameFormatter._get_column_name_listJ  sb     "**$$gz**LLP'--PP  LLw||3Fr_   c                    V ^8  d   QhRRRR/# )rQ   r  r   rX   rZ   )r[   s   "r\   r]   r   S  s      F F)F	Fr_   c                   Ve   \        V4      '       d   V# \        V\        4      '       d(   RV9   d   V#  VP                  R4      pVP                  # \	        R4      h  \        \
        \        3 d   p\	        RT: 24      ThRp?ii ; i)zd
Validates and processes the float_format argument.
Converts new-style format strings to callables.
N%g      ?z Invalid new-style format string z)float_format must be a string or callable)callabler   rU   r[   r1  KeyError
IndexError)rf   r  r   es   &&  r\   r   )DataFrameFormatter._validate_float_formatS  s     ;(3--Jc3cz
X

3A::% DEE #Hj9 X$'Gw%OPVWWXs   A   B6BB)rd   r   r   r   r   r   rL   r   r   rG   rH   r   r   r   rN   r   rO   rI   r   r   r   rp  r   rt   )NNTTrJ   NNNNTNNNF.FT)+r   r   r   r   r   rB   rC   rg   r   propertyr  r  r  rv   r  r  r  r  r"  r'  r   r   r   r   r   r   r   rN  rG  rH  rM  rL  r   rh  ri  r   r  r  r  r   r  r   r   rZ   r_   r\   r   r     s}    !gbG"222G--^
 
 

 T T Y Y W W S S , , . . N N P P F F
&0	!/&>PI('4"$-^

02'RF Fr_   r   c                  V    ] tR tRtRtR R ltRR R lltRR R	 lltRR
 R lltRt	R# )DataFrameRendererik  a  Class for creating dataframe output in multiple formats.

Called in pandas.core.generic.NDFrame:
    - to_csv
    - to_latex

Called in pandas.DataFrame:
    - to_html
    - to_string

Parameters
----------
fmt : DataFrameFormatter
    Formatter with the formatting options.
c                    V ^8  d   QhRRRR/# )rQ   r  r   rX   rY   rZ   )r[   s   "r\   r]   DataFrameRenderer.__annotate__|  s      . 4 r_   c                	    Wn         R # r   r  )rf   r  s   &&r\   rg   DataFrameRenderer.__init__|  s    r_   Nc               8    V ^8  d   QhRRRRRRRRR	R
RRRRRR/# )rQ   rb   "FilePath | WriteBuffer[str] | NoneencodingrV   classeszstr | list | tuple | NonenotebookrT   borderzint | bool | Nonetable_idrender_linksrX   rZ   )r[   s   "r\   r]   r    sd     5B 5B/5B 5B +	5B
 5B "5B 5B 5B 
5Br_   c                    ^ RI HpHp	 V'       d   T	MTp
V
! V P                  VVVVR7      pVP	                  4       p\        WVR7      # )us  
Render a DataFrame to an html table.

Parameters
----------
buf : str, path object, file-like object, or None, default None
    String, path object (implementing ``os.PathLike[str]``), or file-like
    object implementing a string ``write()`` function. If None, the result is
    returned as a string.
encoding : str, default “utf-8”
    Set character encoding.
classes : str or list-like
    classes to include in the `class` attribute of the opening
    ``<table>`` tag, in addition to the default "dataframe".
notebook : {True, False}, optional, default False
    Whether the generated HTML is for IPython Notebook.
border : int or bool
    When an integer value is provided, it sets the border attribute in
    the opening tag, specifying the thickness of the border.
    If ``False`` or ``0`` is passed, the border attribute will not
    be present in the ``<table>`` tag.
    The default value for this parameter is governed by
    ``pd.options.display.html.border``.
table_id : str, optional
    A css id is included in the opening `<table>` tag if specified.
render_links : bool, default False
    Convert URLs to HTML links.
)HTMLFormatterNotebookFormatter)r  r  r  r  rb   r  )pandas.io.formats.htmlr  r  r  r   save_to_buffer)rf   rb   r  r  r  r  r  r  r  r  Klasshtml_formatterstrings   &&&&&&&&     r\   to_htmlDataFrameRenderer.to_html  sN    L	

 &.!=HH%
  ))+fAAr_   c               (    V ^8  d   QhRRRRRRRR/# )rQ   rb   r  r  rV   r   rW   rX   rZ   )r[   s   "r\   r]   r    s8     B B/B B 	B
 
Br_   c                p    ^ RI Hp V! V P                  VR7      pVP                  4       p\	        WaVR7      # )u  
Render a DataFrame to a console-friendly tabular output.

Parameters
----------
buf : str, path object, file-like object, or None, default None
    String, path object (implementing ``os.PathLike[str]``), or file-like
    object implementing a string ``write()`` function. If None, the result is
    returned as a string.
encoding: str, default “utf-8”
    Set character encoding.
line_width : int, optional
    Width to wrap a line in characters.
)StringFormatter)r   r  )pandas.io.formats.stringr  r  r   r  )rf   rb   r  r   r  string_formatterr  s   &&&&   r\   r   DataFrameRenderer.to_string  s3    ( 	=*488
K!++-fAAr_   c          "     \    V ^8  d   QhRRRRRRRRR	R
RRRRRRRRRRRRRRRRRRRRRRRR/# )rQ   path_or_bufz7FilePath | WriteBuffer[bytes] | WriteBuffer[str] | Noner  rV   seprU   r   zSequence[Hashable] | Noneindex_labelzIndexLabel | Noner   compressionr8   quotingrW   	quotecharlineterminator	chunksizedate_formatdoublequoterT   
escapecharerrorsstorage_optionszStorageOptions | NonerX   rZ   )r[   s   "r\   r]   r    s     9 9L9 9 	9
 +9 '9 9 (9 9 9 #9 9  9 9 9  !9" /#9$ 
%9r_   c                b   ^ RI Hp Vf   Rp\        4       pMRpV! R/ RVbRV
bRVbRVbR	VbR
VbRVbRVbRVbRVbRVbRV	bRVbRVbRVbRVbRV P                  b pVP	                  4        V'       d;   \        V\        4      '       g   Q hVP                  4       pVP                  4        V# R# )z+
Render dataframe as comma-separated file.
)CSVFormatterNTFr  r  r  r  r  r  r  r8  r  r   r  r  r  r  r  r  r  rZ   )pandas.io.formats.csvsr  r   r  saver   getvalueclose)rf   r  r  r  r   r  r   r  r  r  r  r  r  r  r  r  r  r  created_buffercsv_formattercontents   &&&&&&&&&&&&&&&&&    r\   to_csvDataFrameRenderer.to_csv  s   , 	8!N"*K"N$ 
#
)
 
 	

 
 $
 
 
 $
 
  
  
 $
 $
 "
  ,!
" hh#
& 	k84444!**,GNr_   r  )NNNFNNF)NNN)NN,NNwinferN"NNNTNr=  N)
r   r   r   r   r   rg   r  r   r  r   rZ   r_   r\   r  r  k  s#     5BnB49 9r_   r  c               (    V ^8  d   QhRRRRRRRR/# )rQ   r  rU   rb   r  r  rV   rX   rZ   )r[   s   "r\   r]   r]     s0      	+  	r_   c                    \        WR7      ;_uu_ 4       pVP                  V 4       Vf   VP                  4       uuRRR4       #  RRR4       R#   + '       g   i     R# ; i)zI
Perform serialization. Write to buf or return as string if buf is None.
)r  N)_get_bufferwriter  )r  rb   r  fds   &&& r\   r  r    sG     
S	,	,
;;;=	 
-	,
  
-	,	,	,s   %AAA!	c               $    V ^8  d   QhRRRRRR/# )rQ   rb   r  r  rV   rX   z1Generator[WriteBuffer[str]] | Generator[StringIO]rZ   )r[   s   "r\   r]   r]     s)     M M	+M7AM6Mr_   c              #    "   V e   \        V 4      p M
\        4       p Vf   RpM!\        V \        4      '       g   \	        R4      h\        V R4      '       d   V x  R# \        V \        4      '       d;   \        \        V 4      4       \        V RVRR7      ;_uu_ 4       pVx  RRR4       R# \        R4      h  + '       g   i     R# ; i5i)	zt
Context manager to open, yield and close buffer for filenames or Path-like
objects, otherwise yield buf unchanged.
Nzutf-8z1buf is not a file name and encoding is specified.r  r  r~   )r  newlinez1buf is not a file name and it has no write method)	r2   r   r   rU   r1  hasattrr1   open	TypeError)rb   r  fs   && r\   r  r    s      S!jS!!LMMsG 		C		s3x(#sXr::a
 G ;: KLL ;::s   BCB8#C8C			Cc               H    V ^8  d   QhRRRRRRRRR	R
RRRRRRRRRR
RRRR/# )rQ   valuesr4   r  r  rL   r   rI   rU   digitsrW   r  zstr | int | Noner   r   r   r   r  fallback_formatterrX   r   rZ   )r[   s   "r\   r]   r]   B  s     R  R R R  )R  	R 
 R  R  R  R  R  R  (R  R r_   c                   \         P                  ! V P                  R4      '       d   \        p\	        \
        V 4      p M\        V P                  \        4      '       d   \        p\	        \
        V 4      p M\         P                  ! V P                  R4      '       d   \        p\	        \        V 4      p M\        V P                  \        4      '       d   \        pMb\         P                  ! V P                  R4      '       d   \        pM4\         P                  ! V P                  R4      '       d   \        pM\        pVf   ^pVf   \!        R4      pVf   \!        R4      pV! V VVVVVVVVV	V
R7      pVP#                  4       # )a=  
Format an array for printing.

Parameters
----------
values : np.ndarray or ExtensionArray
formatter
float_format
na_rep
digits
space
justify
decimal
leading_space : bool, optional, default True
    Whether the array should be formatted with a leading space.
    When an array as a column of a Series or DataFrame, we do want
    the leading space to pad between columns.

    When formatting an Index subclass
    (e.g. IntervalIndex._get_values_for_csv), we don't want the
    leading space since it should be left-aligned.
fallback_formatter

Returns
-------
List[str]
Mmfciura   display.precision)
r  rI   rL   r  r  r   r   r   r  r  )r   is_np_dtyperM   _Datetime64Formatterr   r'   r   r"   _Datetime64TZFormatter_Timedelta64Formatterr)   r#   _ExtensionArrayFormatterFloatArrayFormatter_IntArrayFormatter_GenericArrayFormatterr   
get_result)r  r  rL   rI   r  r  r   r   r   r  r  	fmt_klassfmt_objs   &&&&&&&&&&&  r\   r   r   B  s)   R v||S))(	mV,	FLL/	2	2*	mV,	s	+	+)	nf-	FLL.	1	1,		t	,	,'		t	,	,&	*	}!"89~/0!#-G r_   c                  >    ] tR tRtR
R R lltR R ltR R ltR	tR# )r  i  Nc               L    V ^8  d   QhRRRRRRRRR	R
RRRRRRRRRRRRRRRR/# )rQ   r  r4   r  rn   r  r  rI   rU   r  r  rL   r   r   r   r  rW   fixed_widthrT   r   r   r  rX   rY   rZ   )r[   s   "r\   r]   #_GenericArrayFormatter.__annotate__  s     5 55 5 #	5
 5 5 -5 5 5 5 5 #5 ,5 
5r_   c                	    Wn         W n        W@n        WPn        W0n        W`n        Wpn        Wn        Wn        Wn	        Wn
        Wn        R # r   )r  r  rI   r  r  rL   r   r   r  r#  r   r  )rf   r  r  r  rI   r  rL   r   r   r  r#  r   r  s   &&&&&&&&&&&&&r\   rg   _GenericArrayFormatter.__init__  sD     
"(&*"4r_   c                   V ^8  d   QhRR/# r   rZ   )r[   s   "r\   r]   r$    s     ; ;I ;r_   c                	L    V P                  4       p\        WP                  4      # r   )_format_stringsr  r   )rf   r   s   & r\   r  !_GenericArrayFormatter.get_result  s    ))+
 \\::r_   c                   V ^8  d   QhRR/# r   rZ   )r[   s   "r\   r]   r$    s     D D Dr_   c                	d  a aa S P                   f"   \        R4      pVf   \        R4      oV3R lpMS P                   pS P                  e   S P                  oM`S P                  e   S P                  oMES P                  R J;'       d    S P                  \
        8g  p\        \        P                  RVR7      oVV 3R lpS P                  p\        V\        P                  4      '       g   \        R4      h\        P                  ! V\         4      pV\        P"                  ! \%        V4      \'        \)        ^\+        VP,                  4      4      4      R7      ,          pS P.                  pVf   VP1                  4       p. p\3        V4       F  w  rWi,          '       d   S P                  e%   V'       d   VP5                  RV! V
4       24       KE  Wi,          '       d   VP5                  V! V
4      4       Kl  VR	J d   R
pMRpVP5                  VP7                  V! V
4      R7      4       K  	  V# )Nra   r  c                (   < \        V R SR R2 4      # )z .dr  )_trim_zeros_single_float)r~  	precisions   &r\   <lambda>8_GenericArrayFormatter._format_strings.<locals>.<lambda>  s    )AIa=)**r_   )r   quote_stringsc                  < SP                   e   \        V 4      '       dy   \        V 4      '       dh   V f   R# V \        J d   \	        \        4      # V \
        J g1   \        V \        P                  \        P                  34      '       d   R# SP                   # \        V \        4      '       d   \	        V 4      # \	        S! V 4      4      # )NrY   r   )rI   r    r$   r   rU   r   r   rq   
datetime64timedelta64r*   )r~  r  rf   s   &r\   _format7_GenericArrayFormatter._format_strings.<locals>._format  s    {{&9Q<<DGG9!"Wr7N#XAr~~/N!O!O {{"A|,,1v 9Q<((r_   z=ExtensionArray formatting should use _ExtensionArrayFormatter)axisr  Fz{v}z {v})r  r   )rL   r   r  r  r  r	   r   r3   r   r  r   rq   ndarrayr
  r   	map_inferr   r  r%   ro  rangerm   shaper   anyr  r  r[   )rf   rL   r3  r7  valsinferredis_float_typer   r   r  r  tplr  r0  s   f           @@r\   r)  &_GenericArrayFormatter._format_strings  s   $%&<=L#&':;	   ,,L>>%I$$0//I LL4SS9SM%%/+I	) {{$

++O  ==x0ffU4[uU1c$**o-F'GHI 	
 ** )--/M
dODA!$$(B!!Agaj\"23!!!!,q/2 E)  C C!!#**wqz*":; $ r_   )r   r  r  r#  rL   r  r   r   rI   r  r  r  )   NrJ      Nrightr  NTTN)r   r   r   r   rg   r  r)  r   rZ   r_   r\   r  r    s    58;D Dr_   r  c                  V   a  ] tR tRtR V 3R lltRR R lltR R ltR R	 ltR
tV ;t	# )r  i  c                   V ^8  d   QhRR/# rj   rZ   )r[   s   "r\   r]    FloatArrayFormatter.__annotate__   s     
) 
)4 
)r_   c                	   < \         SV `  ! V/ VB  V P                  eO   V P                  f?   RV n        \        V P                  4      '       d   V P                  V n        R V n        R # R # R # R # NF)superrg   rL   r  r#  r  )rf   argskwargs	__class__s   &*,r\   rg   FloatArrayFormatter.__init__   sh    $)&) (T^^-C$D))**!%!2!2$(! + .D(r_   c               $    V ^8  d   QhRRRRRR/# )rQ   rL   r   	thresholdzfloat | NonerX   r   rZ   )r[   s   "r\   r]   rI    s(     6 6,6  6 
	6r_   c                   a aaaa Sf   S P                   oS'       d	   VV 3R loMV 3R loS P                  R8w  d	   VV 3R loMSoSf   S# VV V3R lpV# )z;Returns a function to be applied on each value to format itc                \   < Sf   Q h\        V 4      '       d
   S! V R7      # SP                  # )N)value)r%   rI   )r  rL   rf   s   &r\   base_formatter<FloatArrayFormatter._value_formatter.<locals>.base_formatter  s7    #/// Qxx !q) r_   c                T   < \        V 4      '       d   \        V 4      # SP                  # r   )r%   rU   rI   )r  rf   s   &r\   rV  rW  +  s    !&qs1v:t{{:r_   r  c                J   < S! V 4      P                  R SP                  ^4      # r  )replacer   )r  rV  rf   s   &r\   decimal_formatter?FloatArrayFormatter._value_formatter.<locals>.decimal_formatter0  s!    %a(00dllAFFr_   c                ~   < \        V 4      '       d!   \        V 4      S8  d	   S! V 4      # S! R 4      # SP                  # )g        )r%   absrI   )rU  r\  rf   rR  s   &r\   r  7FloatArrayFormatter._value_formatter.<locals>.formatter9  s8    U||u:	),U33,S11{{"r_   )rL   r   )rf   rL   rR  r  rV  r\  s   fff @@r\   _value_formatter$FloatArrayFormatter._value_formatter  sZ     ,,L 	; <<3G !/$$	# r_   c                   V ^8  d   QhRR/# )rQ   rX   
np.ndarrayrZ   )r[   s   "r\   r]   rI  D  s     A  A Z A r_   c                  a a
aa R R loR R lo
S P                   e)   S! S P                  S P                   S P                  4      # S P                  '       d   \	        R4      oMRoV
VV V3R lpS P
                  fW   S P                  '       d8   S P                  RJ d   R	pMR
p\        VP                  S P                  R7      pMS P
                  pMV 3R lpV! V4      pS P                  '       g   V# \        V4      ^ 8  d*   \        R V 4       4      pVS P                  ^,           8  pMRp\        P                  ! S P                  4      pVR8  P                  4       pV^
S P                  ) ,          8  V^ 8  ,          P                  4       p	V	'       g   V'       dG   V'       d?   S P                  RJ d   RpMRp\        VP                  S P                  R7      pV! V4      pV# )zp
Returns the float values converted into strings using
the parameters given at initialisation, as a numpy array
c               (    V ^8  d   QhRRRRRRRR/# 	rQ   r  r4   r  r   rI   rU   rX   rd  rZ   )r[   s   "r\   r]   =FloatArrayFormatter.get_result_as_array.<locals>.__annotate__J  s,     
	 
	
	*2
	<?
	
	r_   c           	        \        V 4      p\        P                  ! \        V P	                  4       VP	                  4       R R7       UUu. uF  w  rEV'       g	   V! V4      MTNK  	  upp4      P                  V P                  4      pV# u uppi )Tr<  )r$   rq   arrayrA  ravelreshaper=  )r  r  rI   maskvalr  	formatteds   &&&    r\   format_with_na_repCFloatArrayFormatter.get_result_as_array.<locals>.format_with_na_repJ  sz     <D #&fllndjjl4"P"P +,IcN7"P
 gfll#  s   	B	
c               (    V ^8  d   QhRRRRRRRR/# rg  rZ   )r[   s   "r\   r]   rh  V  s2     	A 	A	A*2	A<?	A	Ar_   c           	        \         P                  ! V 4      P                  4       p\         P                  ! V 4      P                  4       p\	        V4      \	        V4      re. p\        V P                  4       VVVVR R7       F  w  rrpV'       g"   V'       g   VP                  V! V4      4       K0  V'       g    VP                  V! V	4       RV R24       KW  V'       g_   V! V
4      P                  4       pVP                  R4      '       d   VP                  V V R24       K  VP                  V RV R24       K  VP                  V RV R24       K  	  \         P                  ! V4      P                  V P                  4      # )Tr<  +j-)rq   realrk  imagr$   rA  r  strip
startswithrj  rl  r=  )r  r  rI   real_valuesimag_values	real_mask	imag_maskformatted_lstrn  real_valimag_valre_isnaim_isnaimag_formatteds   &&&           r\   format_complex_with_na_repKFloatArrayFormatter.get_result_as_array.<locals>.format_complex_with_na_repV  sI    ''&///1K''&///1K#'#4d;6GyM=@>9x' w!((38 !((Ih,?+@&)KL %.x%8%>%>%@N%0055%,,x7Gq-IJ%,,xq8H-JK!((F81VHA)>?)>* 88M*226<<@@r_   Nzdisplay.chop_thresholdc                  < SP                  V S	4      pSP                  R 8X  d   RSP                  ,           MSP                  pSP                  p\	        V4      pV'       d   S! W1V4      pM	S! W1V4      pSP
                  '       dN   V'       d   \        VSP                  4      pM\        VSP                  4      p\        P                  ! VRR7      # V# )r  r  objectrM   )ra  r   rI   r  r   r#  _trim_zeros_complexr   _trim_zeros_floatrq   asarray)
rL   r  rI   r  
is_complexr   r  rp  rf   rR  s
   &     r\   format_values_withCFloatArrayFormatter.get_result_as_array.<locals>.format_values_with}  s    --lIFI +/,,&*@S4;;&dkkF [[F)&1J 3FvN+FvF0FF.vt||DFzz&99Mr_   Tz{value: .{digits:d}f}z{value:.{digits:d}f})r  c                *   < SP                   V ,          # r   )rL   )rU  rf   s   &r\   r1  9FloatArrayFormatter.get_result_as_array.<locals>.<lambda>  s    ):):U)Br_   c              3  8   "   T F  p\        V4      x  K  	  R # 5ir   rm   r}  r~  s   & r\   r  :FloatArrayFormatter.get_result_as_array.<locals>.<genexpr>  s     :)9AQ)9   Fg    .Az{value: .{digits:d}e}z{value:.{digits:d}e})r  r  rI   r#  r   rL   r   r   r[   r  rm   r  rq   r_  r>  )rf   r  fmt_strrL   formatted_valuesmaxlentoo_longabs_valshas_large_valueshas_small_valuesr  rp  rR  s   f         @@@r\   get_result_as_array'FloatArrayFormatter.get_result_as_arrayD  s   
		A< >>%%dkk4>>4;;OO"#;<II	 	< $%%-5G4G&w~~dkkJ#00BL-l;##  1$:)9::Fa/HH66$++& %sN//1%|(<<ANSSU-=!!T)10"7>>$++FL1,?r_   c                   V ^8  d   QhRR/# r   rZ   )r[   s   "r\   r]   rI    s     0 0 0r_   c                	4    \        V P                  4       4      # r   )rn  r  r   s   &r\   r)  #FloatArrayFormatter._format_strings  s    D,,.//r_   )r#  rL   r  NN)
r   r   r   r   rg   ra  r  r)  r   __classcell__rO  s   @r\   r  r    s$    
) 
)6pA F0 0r_   r  c                  "    ] tR tRtR R ltRtR# )r  i  c                   V ^8  d   QhRR/# r   rZ   )r[   s   "r\   r]   _IntArrayFormatter.__annotate__  s       r_   c                	    V P                   R J d   R pMR pV P                  ;'       g    TpV P                   Uu. uF
  q2! V4      NK  	  ppV# u upi )Fc                *    V R  P                  V R7      # )r.  r~  r[   r  s   &r\   r1  4_IntArrayFormatter._format_strings.<locals>.<lambda>  s    1ooo&:r_   c                *    V R  P                  V R7      # )z dr  r  r  s   &r\   r1  r    s    2&6&6&6&;r_   )r   r  r  )rf   formatter_strr  r~  r   s   &    r\   r)  "_IntArrayFormatter._format_strings  sR    &:M;MNN33m	,0KK8KqilK
8 9s   ArZ   N)r   r   r   r   r)  r   rZ   r_   r\   r  r    s     r_   r  c                  J   a  ] tR tRt$ R]R&   R	R V 3R llltR R ltRtV ;t# )
r  i  r'   r  c               (    V ^8  d   QhRRRRRRRR/# )rQ   r  r'   nat_reprU   r  rY   rX   rZ   )r[   s   "r\   r]   !_Datetime64Formatter.__annotate__  s2     	' 	'	' 	' 		' 
	'r_   c                	B   < \         SV `  ! V3/ VB  W n        W0n        R # r   )rL  rg   r  r  )rf   r  r  r  rN  rO  s   &&&&,r\   rg   _Datetime64Formatter.__init__  s"     	*6*&r_   c                   V ^8  d   QhRR/# r   rZ   )r[   s   "r\   r]   r    s     
# 
# 
#r_   c                    V P                   pV P                  e!   V Uu. uF  q P                  V4      NK  	  up# VP                  V P                  V P                  R7      pVP                  4       # u upi )z&we by definition have DO NOT have a TZ)rI   r  )r  r  _format_native_typesr  r  tolist)rf   r  r~  r   s   &   r\   r)  $_Datetime64Formatter._format_strings  sk    >>%/56v!NN1%v6600<<T-=-= 1 

   "" 7s   A2)r  r  r   N	r   r   r   r   __annotations__rg   r)  r   r  r  s   @r\   r  r    s    	' 	'
# 
#r_   r  c                  .    ] tR tRt$ R]R&   R R ltRtR# )r  i  r(   r  c                   V ^8  d   QhRR/# r   rZ   )r[   s   "r\   r]   %_ExtensionArrayFormatter.__annotate__  s       r_   c                	   V P                   pV P                  pR pVf   VP                  RR7      p\        V\        4      '       d   VP                  4       pM\        P                  ! V\        R7      p\        VVV P                  V P                  V P                  V P                  V P                  V P                  V P                   V P"                  VR7      pV# )NT)boxedr  )	rL   rI   r  r  r   r   r   r  r  )r  r  
_formatterr   r&   _internal_get_valuesrq   r  r  r   rL   rI   r  r  r   r   r   r  )rf   r  r  r  rj  r   s   &     r\   r)  (_ExtensionArrayFormatter._format_strings  s    NN	!!'!2!2!2!>fk**//1EJJvV4E!**;;;;**LLLL,,LL1

 r_   rZ   Nr   r   r   r   r  r)  r   rZ   r_   r\   r  r    s     r_   r  c                    V ^8  d   QhRRRR/# )rQ   percentilesnp.ndarray | Sequence[float]rX   r   rZ   )r[   s   "r\   r]   r]     s     ?" ?"-?"?"r_   c                   \        V 4      ^ 8X  d   . # \        P                  ! V 4      p \        V 4      '       d?   \        P                  ! V ^ 8  4      '       d    \        P                  ! V ^8*  4      '       g   \        R4      h^dV ,          p \        V 4      pV P                  V4      P                  \        4      p\        P                  ! W 4      p\        P                  ! V4      '       d.   VP                  \        4      pV Uu. uF  qUR,           NK  	  up# \        P                  ! V 4      p\        V4      p\        P                  ! V \        R7      pW,          P                  4       P                  \        4      P                  \        4      WC&   W( ,          P                  V4      P                  \        4      WC( &   V Uu. uF  qUR,           NK  	  up# u upi u upi )a#  
Outputs rounded and formatted percentiles.

Parameters
----------
percentiles : list-like, containing floats from interval [0,1]

Returns
-------
formatted : list of strings

Notes
-----
Rounding precision is chosen so that: (1) if any two elements of
``percentiles`` differ, they remain different after rounding
(2) no entry is *rounded* to 0% or 100%.
Any non-integer is always rounded to at least 1 decimal place.

Examples
--------
Keeps all entries different after rounding:

>>> format_percentiles([0.01999, 0.02001, 0.5, 0.666666, 0.9999])
['1.999%', '2.001%', '50%', '66.667%', '99.99%']

No element is rounded to 0% or 100% (unless already equal to it).
Duplicates are allowed:

>>> format_percentiles([0, 0.5, 0.02001, 0.5, 0.666666, 0.9999])
['0%', '50%', '2.0%', '50%', '66.67%', '99.99%']
z/percentiles should all be in the interval [0,1]r  r  )rm   rq   r  r   r  r1  get_precisionroundastypern   iscloserU   unique
empty_liker  )r  precpercentiles_round_typeint_idxoutr  unique_pctss   &      r\   format_percentilesr    ss   D ;1	**[)K [))vvkQ&''vvkQ&''JKK#K%D(..t4;;C@jj/=G	vvg$++C0!$%AC%%))K(K%D
--6
2C'--/66s;BB3GCL)//5<<SACM !SGGS!! & "s   GG c                    V ^8  d   QhRRRR/# )rQ   rj  r  rX   rn   rZ   )r[   s   "r\   r]   r]   T  s      5 # r_   c                z   V ^ ,          ^ 8  d
   V ^ ,          MRpV R,          ^d8  d   ^dV R,          ,
          MRp\         P                  ! WVR7      p\        V4      p\         P                  ! \         P                  ! \         P
                  ! V4      4      4      P                  \        4      ) p\        ^V4      pV# )r   N)to_beginto_end)	rq   ediff1dr_  floorlog10ro   r  rn   r  )rj  r  r  diffr  s   &    r\   r  r  T  s     8a<uQxTH %b	CS59_TF::ev>Dt9DHHRXXbffTl+,33C88Dq$<DKr_   c               $    V ^8  d   QhRRRRRR/# )rQ   r~  NaTType | Timestampr  rU   rX   rZ   )r[   s   "r\   r]   r]   ^  s"      -   r_   c                0    V \         J d   V# \        V 4      # r   )r   rU   r~  r  s   &&r\   _format_datetime64r  ^  s    Cx q6Mr_   c               (    V ^8  d   QhRRRRRRRR/# )rQ   r~  r  r  rU   r  rV   rX   rZ   )r[   s   "r\   r]   r]   g  s0        		r_   c                |    \        V \        4      '       d   V# V'       d   V P                  V4      # V P                  # r   )r   r   strftime
_date_repr)r~  r  r  s   &&&r\   _format_datetime64_dateonlyr  g  s4    
 !Wzz+&& ||r_   c               (    V ^8  d   QhRRRRRRRR/# )	rQ   is_dates_onlyrT   r  rU   r  rV   rX   r   rZ   )r[   s   "r\   r]   r]   v  s2     @ @@"%@<F@@r_   c                0   aa V '       d   VV3R l# V3R l# )zYReturn a formatter callable taking a datetime64 as input and providing
a string as outputc                    < \        V SSR 7      # ))r  r  )r  )r~  r  r  s   &r\   r1  'get_format_datetime64.<locals>.<lambda>}  s    4wK
r_   c                   < \        V SR 7      # )r  )r  r  s   &r\   r1  r    s    +Aw?r_   rZ   )r  r  r  s   &ffr\   get_format_datetime64r  v  s     
 	
 @?r_   c                  .    ] tR tRt$ R]R&   R R ltRtR# )r  i  r'   r  c                   V ^8  d   QhRR/# r   rZ   )r[   s   "r\   r]   #_Datetime64TZFormatter.__annotate__  s     	 	 	r_   c                    V P                   P                  pV P                   P                  \        4      pV P                  ;'       g    \        WP                  R7      pV Uu. uF
  qC! V4      NK  	  ppV# u upi )zwe by definition have a TZ)r  )r  _is_dates_onlyr  r  r  r  r  )rf   idor  r  r~  r   s   &     r\   r)  &_Datetime64TZFormatter._format_strings  sn    kk((##F+NN 
 
&;--'
	 -33FqilF
3 4s   $A8rZ   Nr  rZ   r_   r\   r  r    s    	 	r_   r  c                  J   a  ] tR tRt$ R]R&   R	R V 3R llltR R ltRtV ;t# )
r  i  r)   r  c               $    V ^8  d   QhRRRRRR/# )rQ   r  r)   r  rU   rX   rY   rZ   )r[   s   "r\   r]   "_Timedelta64Formatter.__annotate__  s(       
 
r_   c                	6   < \         SV `  ! V3/ VB  W n        R # r   )rL  rg   r  )rf   r  r  rN  rO  s   &&&,r\   rg   _Timedelta64Formatter.__init__  s     	*6*r_   c                   V ^8  d   QhRR/# r   rZ   )r[   s   "r\   r]   r    s     3 3 3r_   c                	    V P                   ;'       g#    \        V P                  V P                  R R7      pV P                   Uu. uF
  q!! V4      NK  	  up# u upi )F)r  box)r  get_format_timedelta64r  r  )rf   r  r~  s   &  r\   r)  %_Timedelta64Formatter._format_strings  sN    NN 
 
&<KK5'
	 '+kk2k	!k222s   Ar  r   r  r  s   @r\   r  r    s     3 3r_   r  c               (    V ^8  d   QhRRRRRRRR/# )	rQ   r  r)   r  zstr | floatr  rT   rX   r   rZ   )r[   s   "r\   r]   r]     s0       
 	r_   c                N   aaa V P                   pV'       d   RoMRoVVV3R lpV# )z
Return a formatter function for a range of timedeltas.
These will all have the same format argument

If box, then show the return in quotes
Nlongc                   < V e#   \        V 4      '       d   \        V 4      '       d   S# \        V \        4      '       g   \        V 4      p V P	                  SR7      pS'       d   RV R2pV# )Nr  ')r    r$   r   r   
_repr_base)r~  r   r  r[   r  s   & r\   r  *get_format_timedelta64.<locals>._formatter  sZ    91$q''N!Y''!A V,]Fr_   )r  )r  r  r  	even_daysr  r[   s   &ff  @r\   r  r    s*     %%I r_   c          
     ,    V ^8  d   QhRRRRRRRRR	R/# )
rQ   rx  r   r   rU   ry  rW   rd   zprinting._TextAdjustment | NonerX   rZ   )r[   s   "r\   r]   r]     s:        
)	
 r_   c                d  aaa	 \        V 4      ^ 8X  g   VR8X  d   V # Vf   \        P                  ! 4       oMVo\        V3R lV  4       4      o	Ve   \        VS	4      o	\	        R4      oSe
   S	S8  d   So	R VVV	3R llpV  Uu. uF
  qT! V4      NK  	  p pSP                  V S	VR7      pV# u upi )r   r  c              3  F   <"   T F  pSP                  V4      x  K  	  R # 5ir   r  )r}  r~  
adjustments   & r\   r  $_make_fixed_width.<locals>.<genexpr>  s     5W*..##Ws   !r   c                    V ^8  d   QhRRRR/# )rQ   r~  rU   rX   rZ   )r[   s   "r\   r]   '_make_fixed_width.<locals>.__annotate__  s        r_   c                ~   < Se8   S^8  SP                  V 4      S8  ,          '       d   V R S^,
           R,           p V # )Nr   r  )r~  r  conf_maxr  s   &r\   just_make_fixed_width.<locals>.just  s@    1!2W!<==m!$u,r_   r   )rm   r3   rc   r  r   r   )
rx  r   ry  rd   r  r~  r   r  r  r  s
   &&&&   @@@r\   r  r    s     7|qGu,
{,,.

5W55Ggw'01H( 2  !((1tAwG(w?FM )s   B-c               $    V ^8  d   QhRRRRRR/# )rQ   str_complexesr4   r   rU   rX   r   rZ   )r[   s   "r\   r]   r]     s!      y 3  r_   c                   . . r2V  F`  p\         P                  ! RV4      pVP                  RP                  VRR
 4      4       VP                  RP                  VR
R 4      4       Kb  	  \	        V 4      p\        W#,           V4      p\	        V4      ^ 8X  d   . # \        R V 4       4      ^,
          p\        VRV WvR RR7       U	U
u. uF/  w  rV	V
^ ,          ,           V
R,          RV 2 ,           R	,           NK1  	  pp	p
V# u up
p	i )z}
Separates the real and imaginary parts from the complex number, and
executes the _trim_zeros_float method on each of those.
z(?<!e)([j+-])r~   Nc              3  8   "   T F  p\        V4      x  K  	  R # 5ir   r  )r}  parts   & r\   r  &_trim_zeros_complex.<locals>.<genexpr>  s     ;ldD		lr  Tr<  r   >ru  )rer   r  r   rm   r  r  rA  )r  r   	real_part	imag_partr~  trimmednpadded_partspadded_lengthreal_ptimag_ptpaddeds   &&          r\   r  r    s#   
 ry
 ((+Q/"./B01  	MA$Y%:GDL
<A	;l;;a?M !$L!$4l26Ft T
 !UG	 	
!*	R[=/)*	, 	 	 !U   Ms   5Dc                    V ^8  d   QhRRRR/# )rQ   	str_floatrU   rX   rZ   )r[   s   "r\   r]   r]     s     	 	 	 	r_   c                h    V P                  R4      p V P                  R4      '       d
   V R,          p V # )zL
Trims trailing zeros after a decimal point,
leaving just one if necessary.
0r  )rstripendswith)r,  s   &r\   r/  r/    s5    
   %I#S	r_   c               $    V ^8  d   QhRRRRRR/# )rQ   
str_floatsArrayLike | list[str]r   rU   rX   r   rZ   )r[   s   "r\   r]   r]     s$     ! !%!03!!r_   c                `  aa T p\         P                  ! RV R24      oR V3R lloR V3R llpV! V4      '       d'   V Uu. uF  pS! V4      '       d   VRR	 MTNK  	  ppK4  V Uu. uF3  pS! V4      '       d!   VP                  V4      '       d
   VR,           MTNK5  	  ppV# u upi u upi )
zy
Trims the maximum number of trailing zeros equally from
all numbers containing decimals, leaving just one if
necessary.
z^\s*[\+-]?[0-9]+\z[0-9]*$c                   V ^8  d   QhRR/# r   rZ   )r[   s   "r\   r]   '_trim_zeros_float.<locals>.__annotate__#  s     5 5T 5r_   c                6   < \         P                  ! SV 4      R J# r   )r!  match)r~  number_regexs   &r\   is_number_with_decimal1_trim_zeros_float.<locals>.is_number_with_decimal#  s    xxa(44r_   c                    V ^8  d   QhRRRR/# )rQ   r  r3  rX   rT   rZ   )r[   s   "r\   r]   r6  &  s     	J 	J1 	Jd 	Jr_   c                   < V  Uu. uF  pS! V4      '       g   K  VNK  	  pp\        V4      ^ 8  ;'       d5    \        ;QJ d    R V 4       F  '       d   K   R# 	  R# ! R V 4       4      # u upi )z
Determine if an array of strings should be trimmed.

Returns True if all numbers containing decimals (defined by the
above regular expression) within the array end in a zero, otherwise
returns False.
c              3  B   "   T F  qP                  R 4      x  K  	  R# 5i)r.  N)r0  r  s   & r\   r  9_trim_zeros_float.<locals>.should_trim.<locals>.<genexpr>/  s     'IA

3   FT)rm   r  )r  r~  numbersr:  s   &  r\   should_trim&_trim_zeros_float.<locals>.should_trim&  sc     %Bf(>q(A11fB7|aIICC'I'ICCICIC'I'I$II Cs
   A-A-Nr.  r  )r!  compiler0  )r2  r   r$  rB  r~  r   r:  r9  s   &&    @@r\   r  r    s     G::!27)7CDL5 5	J 	J g

GNOw!3A661Sb6A=wO
 A *!,,G1D1DC!K   M Ps   B&B&)B+<B+B+c                    V ^8  d   QhRRRR/# )rQ   rH   r+   rX   rT   rZ   )r[   s   "r\   r]   r]   <  s     & &e & &r_   c                    \        V \        4      '       d   \        P                  ! V P                  !  # V P
                  R J# r   )r   r,   comany_not_noner  rK   )rH   s   &r\   r   r   <  s3    %$$--zz%%r_   c                      ] tR tRtRt/ RRbRRbRRbRRbRRbRRbR R	bR!R
b^ Rb^Rb^Rb^	Rb^Rb^Rb^Rb^Rb^RbtR"R R lltR R ltRtR# )#EngFormatteriC  z`
Formats float values according to engineering format.

Based on matplotlib.ticker.EngFormatter
yzar  pr%  ur  r~   r  r  GTPEZYNc               $    V ^8  d   QhRRRRRR/# )rQ   accuracyrW   use_eng_prefixrT   rX   rY   rZ   )r[   s   "r\   r]   EngFormatter.__annotate___  s$     - -"-;?-	-r_   c                	    Wn         W n        R # r   rW  rX  )rf   rW  rX  s   &&&r\   rg   EngFormatter.__init___  s     !,r_   c                    V ^8  d   QhRRRR/# )rQ   numfloatrX   rU   rZ   )r[   s   "r\   r]   rY  e  s     ; ;E ;c ;r_   c                X   \        \        V4      4      p\         P                  ! V4      '       d   R# \         P                  ! V4      '       d   R# ^pV^ 8  d   RpV) pV^ 8w  dF   \        \	        \
        P                  ! VP                  4       ^,          4      ^,          4      4      pM\        ^ 4      pVP                  \        V P                  P                  4       4      4      pVP                  \        V P                  P                  4       4      4      p\	        V4      pV P                  '       d   V P                  V,          pMV^ 8  d	   RV) R 2pMRVR 2pW2,          ^
V,          ,          pV P                  f   RpMRV P                  R R	2pVP                  WvR
7      p	V	# )aq  
Formats a number in engineering notation, appending a letter
representing the power of 1000 of the original number. Some examples:
>>> format_eng = EngFormatter(accuracy=0, use_eng_prefix=True)
>>> format_eng(0)
' 0'
>>> format_eng = EngFormatter(accuracy=1, use_eng_prefix=True)
>>> format_eng(1_000_000)
' 1.0M'
>>> format_eng = EngFormatter(accuracy=2, use_eng_prefix=False)
>>> format_eng("-1e-6")
'-1.00E-06'

@param num: the value to represent
@type num: either a numeric value or a string that can be converted to
           a numeric value (as per decimal.Decimal constructor)

@return: engineering formatted string
rJ   infzE-02dzE+z{mant: g}{prefix}z{mant: .r.  z
f}{prefix})mantprefixr  )r
   rU   is_nanis_infinitern   mathr  r  ro   r  ENG_PREFIXESr@  rX  rW  r[   )
rf   r^  dnumsignpow10	int_pow10rd  rc  
format_strro  s
   &&        r\   __call__EngFormatter.__call__e  sd   ( s3x >>$t$$!8D5D19C

4::<!+; <q @ABEAJE		#d//44678		#d//44678J	&&y1F]9*S)*F)C)F{b%i(== ,J$T]]1$5]CJ%%4%?	r_   r[  iiiiiiirK  )	r   r   r   r   r   rh  rg   rn  r   rZ   r_   r\   rJ  rJ  C  s    SS 	S 	S	
 	S 	C 	C 	C 	
2 	
3 	
3 	
3 	C 	C 	C  	C!" 	C#L(-; ;r_   rJ  pandasc               $    V ^8  d   QhRRRRRR/# )rQ   rW  rn   rX  rT   rX   rY   rZ   )r[   s   "r\   r]   r]     s+     AO AO3 AOD AOT AOr_   c                0    \        R\        W4      4       R# )a  
Format float representation in DataFrame with SI notation.

Sets the floating-point display format for ``DataFrame`` objects using engineering
notation (SI units), allowing easier readability of values across wide ranges.

Parameters
----------
accuracy : int, default 3
    Number of decimal digits after the floating point.
use_eng_prefix : bool, default False
    Whether to represent a value with SI prefixes.

Returns
-------
None
    This method does not return a value. it updates the global display format
    for floats in DataFrames.

See Also
--------
set_option : Set the value of the specified option or options.
reset_option : Reset one or more options to their default value.

Examples
--------
>>> df = pd.DataFrame([1e-9, 1e-3, 1, 1e3, 1e6])
>>> df
              0
0  1.000000e-09
1  1.000000e-03
2  1.000000e+00
3  1.000000e+03
4  1.000000e+06

>>> pd.set_eng_float_format(accuracy=1)
>>> df
         0
0  1.0E-09
1  1.0E-03
2  1.0E+00
3  1.0E+03
4  1.0E+06

>>> pd.set_eng_float_format(use_eng_prefix=True)
>>> df
        0
0  1.000n
1  1.000m
2   1.000
3  1.000k
4  1.000M

>>> pd.set_eng_float_format(accuracy=1, use_eng_prefix=True)
>>> df
      0
0  1.0n
1  1.0m
2   1.0
3  1.0k
4  1.0M

>>> pd.set_option("display.float_format", None)  # unset option
ra   N)r   rJ  r[  s   &&r\   set_eng_float_formatrt    s    D %|H'MNr_   c               $    V ^8  d   QhRRRRRR/# )rQ   levelsr   sentinelzbool | object | strrX   zlist[dict[int, int]]rZ   )r[   s   "r\   r]   r]     s$     ( ((.((r_   c                :   \        V 4      ^ 8X  d   . # R.\        V ^ ,          4      ,          p. pV  Ff  p^ p/ p\        V4       F+  w  rxW',          '       d	   W8X  d   K  RW'&   Wu,
          We&   TpK-  	  \        V4      V,
          We&   VP                  V4       Kh  	  V# )am  
For each index in each level the function returns lengths of indexes.

Parameters
----------
levels : list of lists
    List of values on for level.
sentinel : string, optional
    Value which states that no new index starts on there.

Returns
-------
Returns list of maps. For each level returns map of indexes (key is index
in row and value is length of index).
TF)rm   r  r  )	rv  rw  controlr   level
last_indexlengthsr  keys	   &&       r\   get_level_lengthsr~    s    $ 6{a	fs6!9~%GF
&FAzzco"
&'n#
 ' "%j:5g   Mr_   c               $    V ^8  d   QhRRRRRR/# )rQ   rb   zWriteBuffer[str]linesr   rX   rY   rZ   )r[   s   "r\   r]   r]     s"        *  9    r_   c                    \         ;QJ d    R V 4       F  '       g   K   RM	  RM! R V 4       4      '       d   V Uu. uF  p\        V4      NK  	  ppV P                  RP                  V4      4       R# u upi )zq
Appends lines to a buffer.

Parameters
----------
buf
    The buffer to write to
lines
    The lines to append.
c              3  B   "   T F  p\        V\        4      x  K  	  R # 5ir   )r   rU   r  s   & r\   r  #buffer_put_lines.<locals>.<genexpr>  s     
-u!:aur@  TFr   N)r>  rU   r  r   )rb   r  r~  s   && r\   buffer_put_linesr    sW     s
-u
-sss
-u
---!&'AQ'IIdii (s   A7)r  rF  r   r   zjustify-allstartendinheritzmatch-parentinitialunsetr  r   )	NrJ   NNrF  r  TNNr  r  )r   F)rF  NNrZ  )   F)r~   )__conditional_annotations__r   
__future__r   collections.abcr   r   r   r   r   
contextlibr   csvr	   r   r
   	functoolsr   ior   rg  r!  shutilr   typingr   r   r   r   numpyrq   pandas._config.configr   r   pandas._libsr   pandas._libs.missingr   pandas._libs.tslibsr   r   r   pandas._libs.tslibs.nattyper   pandas.util._decoratorsr   pandas.core.dtypes.commonr   r   r   r   r   r    pandas.core.dtypes.dtypesr!   r"   r#   pandas.core.dtypes.missingr$   r%   pandas.core.arraysr&   r'   r(   r)   pandas.core.baser*   pandas.core.commoncorecommonrG  pandas.core.indexes.apir+   r,   r-   r.   pandas.core.indexes.datetimesr/   pandas.core.indexes.timedeltasr0   pandas.io.commonr1   r2   r   r3   pandas._typingr4   r5   r6   r7   r8   r9   r:   r;   r<   r=   r>   r?   rq  r@   rA   rB   r  VALID_JUSTIFY_PARAMETERSrC   rE   r   r   r   r  r  r  r   r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r/  r  r   rJ  rt  r~  r  )r  s   @r\   <module>r     s  
 #  &      	 $  
  # 
 0 .  

  *      8 9 '   6 % 6p  % c$ c$L>:IF IFX^ ^B  M MJR je ePI00 I0X/ #1 #65 B?"D@1 32 3(DDB	!H&] ]@ HAO AOH(V r_   