+
    ÏÜ³jo  ã                  ó’   € R t ^ RIHt ^ RIHt ^ RIt^ RIHt ^ RI	H
t
Ht ]'       d   ^ RIHt ^ RIHt R R	 ltR
 R ltR R ltR# )zH
Module containing utilities for NDFrame.sample() and .GroupBy.sample()
)Úannotations)ÚTYPE_CHECKINGN)Úlib)ÚABCDataFrameÚ	ABCSeries)ÚAxisInt)ÚNDFramec               ó$   € V ^8„  d   QhRRRRRR/# )é   Úobjr   Úaxisr   Úreturnú
np.ndarray© )Úformats   "ÚS/home/luca/screen-checking/.venv/lib/python3.14/site-packages/pandas/core/sample.pyÚ__annotate__r      s!   € ÷ 6ñ 6˜Gð 6°Gð 6À
ñ 6ó    c                óN  € \        V\        4      '       d#   VP                  V P                  V,          4      p\        V\        4      '       d>   \        V \
        4      '       d   V^ 8X  d    W,          pM\        R4      h\        R4      h\        V \        4      '       d   V P                  pMV P                  pV! VRR7      P                  p\        V4      V P                  V,          8w  d   \        R4      h\        P                  ! V4      '       d   \        R4      hV^ 8  P                  4       '       d   \        R	4      h\         P"                  ! V4      pVP                  4       '       d   VP%                  4       p^ W&   V#   \         d   p\        R4      ThRp?ii ; i)
zê
Process and validate the `weights` argument to `NDFrame.sample` and
`.GroupBy.sample`.

Returns `weights` as an ndarray[np.float64], validated except for normalizing
weights (because that must be done groupwise in groupby sampling).
z+String passed to weights not a valid columnNzLStrings can only be passed to weights when sampling from rows on a DataFramez@Strings cannot be passed as weights when sampling from a Series.Úfloat64)Údtypez5Weights and axis to be sampled must be of same lengthz*weight vector may not include `inf` valuesz.weight vector many not include negative values)Ú
isinstancer   ÚreindexÚaxesÚstrr   ÚKeyErrorÚ
ValueErrorÚ_constructorÚ_constructor_slicedÚ_valuesÚlenÚshaper   Úhas_infsÚanyÚnpÚisnanÚcopy)r   Úweightsr   ÚerrÚfuncÚmissings   &&&   r   Úpreprocess_weightsr+      sd  € ô �'œ9×%Ò%Ø—/‘/ #§(¡(¨4¥.Ó1ˆô �'œ3×ÒÜ�cœ<×(Ò(Ø�qŒyðØ!�l‘Gô !ð"óð ô ØRóð ô �#”y×!Ò!Ø×Ñ‰à×&Ñ&ˆá�7 )Ô,×4Ñ4€Gä
ˆ7ƒ|�s—y‘y •Ô&ÜÐPÓQÐQä
‡|‚|�G×ÒÜÐEÓFÐFà�!‰×Ñ×ÒÜÐIÓJÐJä�hŠh�wÓ€GØ‡{�{‡}‚}à—,‘,“.ˆØˆÑØ€NøôI  ô Ü"ØEóàðûðús   Á-F ÆF$ÆFÆF$c               ó(   € V ^8„  d   QhRRRRRRRR/# )r
   Únz
int | NoneÚfraczfloat | NoneÚreplaceÚboolr   r   )r   s   "r   r   r   Q   s,   € ÷ "ñ "Øð"Ø%ð"Ø04ð"àñ"r   c                ó  € V f	   Vf   ^p V # V e   Ve   \        R4      hV e/   V ^ 8  d   \        R4      hV ^,          ^ 8w  d   \        R4      h V # Vf   Q hV^8”  d   V'       g   \        R4      hV^ 8  d   \        R4      hV # )zÎ
Process and validate the `n` and `frac` arguments to `NDFrame.sample` and
`.GroupBy.sample`.

Returns None if `frac` should be used (variable sampling sizes), otherwise returns
the constant sampling size.
z0Please enter a value for `frac` OR `n`, not bothz=A negative number of rows requested. Please provide `n` >= 0.z$Only integers accepted as `n` valueszJReplace has to be set to `True` when upsampling the population `frac` > 1.z@A negative number of rows requested. Please provide `frac` >= 0.)r   )r-   r.   r/   s   &&&r   Úprocess_sampling_sizer2   Q   s»   € ð 	‚y�T’\Øˆð, €Hð+ 
Š˜4Ò+ÜÐKÓLÐLØ	
ŠØˆqŒ5ÜØOóð ð ˆq�5�AŒ:ÜÐCÓDÐDð ð €Hð ÒÐÐØ�!Œ8ŸGÜð8óð ð �!Œ8ÜØRóð ð €Hr   c               ó0   € V ^8„  d   QhRRRRRRRRRR	R
R/# )r
   Úobj_lenÚintÚsizer/   r0   r'   znp.ndarray | NoneÚrandom_statez+np.random.RandomState | np.random.Generatorr   r   r   )r   s   "r   r   r   v   sD   € ÷ -ñ -Øð-à
ð-ð ð-ð ð	-ð
 >ð-ð ñ-r   c                ó,  € Ve`   VP                  4       pV^ 8w  d
   W5,          pM\        R4      hVf   Q hV'       g'   WP                  4       ,          ^8”  d   \        R4      hVP                  WW#R7      P	                  \
        P                  RR7      # )a  
Randomly sample `size` indices in `np.arange(obj_len)`.

Parameters
----------
obj_len : int
    The length of the indices being considered
size : int
    The number of values to choose
replace : bool
    Allow or disallow sampling of the same row more than once.
weights : np.ndarray[np.float64] or None
    If None, equal probability weighting, otherwise weights according
    to the vector normalized
random_state: np.random.RandomState or np.random.Generator
    State used for the random sampling

Returns
-------
np.ndarray[np.intp]
z$Invalid weights: weights sum to zeroz‘Weighted sampling cannot be achieved with replace=False. Either set replace=True or use smaller weights. See the docstring of sample for details.)r6   r/   ÚpF)r&   )Úsumr   ÚmaxÚchoiceÚastyper$   Úintp)r4   r6   r/   r'   r7   Ú
weight_sums   &&&&& r   Úsampler@   v   s•   € ð8 ÒØ—[‘[“]ˆ
Ø˜Œ?ØÕ*‰GäÐCÓDÐDàÒ"Ð"Ð"ß˜4§+¡+£-Õ/°!Ô3Üð&óð ð ×Ñ˜w¸7ÐÓN×UÑUÜ
�‰�eð Vó ð r   )Ú__doc__Ú
__future__r   Útypingr   Únumpyr$   Úpandas._libsr   Úpandas.core.dtypes.genericr   r   Úpandas._typingr   Úpandas.core.genericr   r+   r2   r@   r   r   r   Ú<module>rI      s9   ðñõ #å  ã å ÷÷
 Ý&å+õ6õr"÷J-r   