L i\$dZddlZddlZdZdZy)zEAlgorithms to support fitting routines in seaborn plotting functions.Nc ttjtt t|dkDr t dt|d}|j dd}|j dd}|j dd }|j d d }|j d d }|d }tj||j d |} | t} n t|} t| tjjr| } ntjj| } tt tj|}|tj|}t|trt!t|} tj"tj$tj&|} | rM|j)ds|S#t.$r| j0}YwxYwcc}w)avResample one or more arrays with replacement and store aggregate values. Positional arguments are a sequence of arrays to bootstrap along the first axis and pass to a summary function. Keyword arguments: n_boot : int, default=10000 Number of iterations axis : int, default=None Will pass axis to ``func`` as a keyword argument. units : array, default=None Array of sampling unit IDs. When used the bootstrap resamples units and then observations within units instead of individual datapoints. func : string or callable, default="mean" Function to call on the args that are passed in. If string, uses as name of function in the numpy namespace. If nans are present in the data, will try to use nan-aware version of named function. seed : Generator | SeedSequence | RandomState | int | None Seed for the random number generator; useful if you want reproducible resamples. Returns ------- boot_dist: array array of bootstrapped statistic values z*All input arrays must have the same lengthrn_booti'funcmeanaxisNunits random_seedz<`random_seed` has been renamed to `seed` and will be removedseedrnanz/Data contain nans but no nan-aware version of `z` founddtype) lennpuniquelistmap ValueErrorgetwarningswarndict isinstancerandom RandomState default_rngasarraystrgetattrisnansum column_stack startswith UserWarningintegersAttributeErrorrandint_structured_bootstraprangeintintptakeappendarray)argskwargsnrrrr r msgr func_kwargsrngf missing_datananfr& boot_disti resamplerasamples X/mnt/ssd/data/python-lab/Trading/venv/lib/python3.12/site-packages/seaborn/algorithms.py bootstrapr?sy< 299T#c4.) *+a/EFF DG AZZ% (F ::ff %D ::fd #D JJw %E**]D1KL c ::fk *D |f o $ --.ii##D) BJJ% &D  5!$ B xxrt'< =>  62TF|T2D|GvWU c;/ <<  $T65!%0(< <I 3v; 4Q1BGG4 59:!&&&+::F2k234 88I  ;;;s J:0K:KKctj|}t|}|D cgc]}|D cgc] } ||| k( c} }}} g} tt |D]} |d||tj } |D cgc]}| D cgc]} ||  c} } }} t t| d}|Dcgc]}|d||tj } }| Dcgc]2}t|| Dcgc]\}}|j|dc}}4} }}}tt tj| } | j|| i|tj| Scc} wcc} }wcc} wcc} }wcc}wcc}}wcc}}}w)z%Resample units instead of datapoints.rrr ) rrrr*r+r,rzipr-r concatenater.r/)r0rr rr4r& unique_unitsn_unitsr<unitr9r:r;r=lengthsr2crs r>r)r)hsV99U#L,GAE FA, 7$Qu}  7 FD FI 3v; 7Q@ 59:+A1Q4+::c6!9%?FG!XaARWW5G GMSTTQ 1BCA166!!6$CTTc"..&12v5567 88I  8 F ,:GCTsK E,E' E,> E7 E2E72!E=F /F F 'E,2E7F )__doc__numpyrrr?r)r>rMsK_DrL