1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
U
O±de,ã@sdZddlZddlmZddlmZddlmZddl    m
Z
ddlm Z ddlm Z dd    lmZdd
lmZdd lmZmZejjZejjZejjZejjZejjZej jZ!e  "e j#¡e  "e j$¡e  "e j%¡e  "e j&¡iZ'e  "e j(¡e  "e j&¡kre' )e  "e j*¡e  "e j(¡i¡ddd ed fdd„Z+ddd ed fdd„Z,dddd ed fdd„Z-dddd ed fdd„Z.d4d dœdd„Z/d5d dœdd„Z0d6dd„Z1dd„Z2dd „Z3ddd!œd"d#„Z4d7dd$œd%d&„Z5d8d dœd'd(„Z6d9d dœd)d*„Z7d:d dœd+d,„Z8d;d-d.„Z9d<d0d1„Z:d=d2d3„Z;dS)>zx
Array methods which are called by both the C-code for the method
and the Python code for the NumPy-namespace function
 
éN)Ú nullcontext)Ú
multiarray)Úumath)Ú
asanyarray)Ú numerictypes)Ú _exceptions)Ú_no_nep50_warning)Ú_NoValue)ÚpickleÚ    os_fspathFTcCst||d||||ƒS©N)Ú umr_maximum©ÚaÚaxisÚoutÚkeepdimsÚinitialÚwhere©rúJd:\z\workplace\vscode\pyvenv\venv\Lib\site-packages\numpy/core/_methods.pyÚ_amax'srcCst||d||||ƒSr )Ú umr_minimumrrrrÚ_amin+srcCst|||||||ƒSr )Úumr_sum©rrÚdtyperrrrrrrÚ_sum/srcCst|||||||ƒSr )Úumr_prodrrrrÚ_prod3sr©rcCs,|dkrt|||||ƒSt||||||dS©NTr )Úumr_any©rrrrrrrrrÚ_any7sr$cCs,|dkrt|||||ƒSt||||||dSr!)Úumr_allr#rrrÚ_all=sr&cCsŒ|dkrb|dkr tt|jƒƒ}nt|tƒs0|f}d}|D]}||jt ||j¡9}q8t |¡}n&ddl    m
}t |||jƒ|tjd|ƒ}|S)NTér)Ú broadcast_to) ÚtupleÚrangeÚndimÚ
isinstanceÚshapeÚmuZnormalize_axis_indexÚntZintpZnumpy.lib.stride_tricksr(r)ÚarrrrrÚitemsZaxr(rrrÚ_count_reduce_itemsCs
  ÿr2cCsDddlm}||ƒdkrdSz t |¡WStk
r>YdSXdS)Nr)r+F)Znumpy.core.fromnumericr+ÚumÚisnanÚ    TypeError)rr+rrrÚ_clip_dep_is_scalar_nan]s   r6cCst|tjƒr|jj SdS)NF)r,r.ÚndarrayrZisnative)rrrrÚ_clip_dep_is_byte_swappedgs 
r8©rÚcastingc
OsŽ|dk    r||||dœ|—ŽSz||d|i|—ŽWStjk
rˆ}z8tjd |j|j¡tdd|||ddœ|—ŽWY¢Sd}~XYnXdS)Nr9rz Converting the output of clip from {!r} to {!r} is deprecated. Pass `casting="unsafe"` explicitly to silence this warning, or correct the type of the variables.é©Ú
stacklevelÚunsafe)rZ_UFuncOutputCastingErrorÚwarningsÚwarnÚformatÚfrom_ÚtoÚDeprecationWarning)Zufuncrr:ÚargsÚkwargsÚerrrÚ_clip_dep_invoke_with_castinglsþûrH)r:cKsÔ|dkr|dkrtdƒ‚t|ƒsjt|ƒsjd}t|ƒrBtdƒ }d}t|ƒrVtdƒ}d}|rjtjdtdd|dkrŽttj    ||f||dœ|—ŽS|dkr²ttj
||f||dœ|—ŽSttj |||f||dœ|—ŽSdS)    NzOne of max or min must be givenFÚinfTaPassing `np.nan` to mean no clipping in np.clip has always been unreliable, and is now deprecated. In future, this will always return nan, like it already does when min or max are arrays that contain nan. To skip a bound, pass either None or an np.inf of an appropriate sign.r;r<r9) Ú
ValueErrorr8r6Úfloatr?r@rDrHr3ÚminimumÚmaximumZclip)rÚminÚmaxrr:rFZusing_deprecated_nanrrrÚ_clipsb
ø ÿÿÿÿÿÿÿÿÿrPc
    Cs8t|ƒ}d}t||||d}|dkr.|dkrNnt|dkddrNtjdtdd|dkr–t|jjt    j
t    j fƒrxt  d    ¡}nt|jjt    j ƒr–t  d
¡}d}t||||||d }    t|    t jƒrötƒtj|    ||    d dd }    W5QRX|rô|dkrô|j |    ¡}    n>t|    dƒr,|r|j |    |¡}    n|    j |    |¡}    n|    |}    |    S)NF©rrTr©rzMean of empty slice.r;r<Úf8Zf4r r>©rr:Zsubokr)rr2r"r?r@ÚRuntimeWarningÚ
issubclassrÚtyper/ÚintegerÚbool_r.Úfloat16rr,r7rr3Ú true_divideÚhasattr)
rrrrrrr0Zis_float16_resultÚrcountÚretrrrÚ_mean¤s:" 
 ÿ  r_c    Cst|ƒ}t||||d}|dkr*||krJnt||kddrJtjdtdd|dkrrt|jjt    j
t    j fƒrrt  d¡}t |||d|d}    |jdkr”|}
n | |    j¡}
t|    t jƒrÔtƒtj|    |
|    d    d
d }    W5QRXn$t|    d ƒrð|    j |    |¡}    n|    |}    t||    ƒ} t|jjt    jt    j
fƒr.tj| | | d } nh| jtkr~| jt| jdfd} tj| | | d tj| d| d| jd j} ntj| t | ¡| d j} t | |||||d} t ||d¡}t| t jƒrðtƒtj| || d    d
d } W5QRXn&t| d ƒr| j | |¡} n| |} | S)NrQTrRz!Degrees of freedom <= 0 for slicer;r<rSrr>FrTr©r)r;)r).r).r')rr2r"r?r@rUrVrrWr/rXrYr.rr+Zreshaper-r,r7rr3r[r\ZfloatingÚmultiplyÚ_complex_to_floatÚviewÚaddÚrealÚ    conjugaterM)rrrrÚddofrrr0r]ZarrmeanÚdivÚxZxvr^rrrÚ_varÆsX"ÿ
 
 
ÿ
  ÿ rjc    Cs^t|||||||d}t|tjƒr2tj||d}n(t|dƒrP|j t |¡¡}n
t |¡}|S)N)rrrrgrrr`r)    rjr,r.r7r3Úsqrtr\rrW)rrrrrgrrr^rrrÚ_std s ÿ 
 
rlc    Cs&t t||d||ƒt||dd|ƒ|¡Sr )r3Úsubtractr r)rrrrrrrÚ_ptps
ýrnr;c    CsFt|dƒrt|ƒ}ntt|ƒdƒ}|}tj|||dW5QRXdS)NÚwriteÚwb©Úprotocol)r\rÚopenr r
Údump)ÚselfÚfilerrÚctxÚfrrrÚ_dump s
 
 
rycCstj||dS)Nrq)r
Údumps)rurrrrrÚ_dumps(sr{)NNNF)NNNF)FT)NNN)NNNF)NNNrF)NNNrF)NNF)r;)r;)<Ú__doc__r?Ú
contextlibrZ
numpy.corerr.rr3Znumpy.core.multiarrayrrr/rZnumpy.core._ufunc_configrZnumpy._globalsr    Z numpy.compatr
r rMÚreducer rLrrdrrarÚ
logical_orr"Ú logical_andr%rZcsingleZsingleZcdoubleÚdoublerbZ
longdoubleÚupdateZ clongdoublerrrrr$r&r2r6r8rHrPr_rjrlrnryr{rrrrÚ<module>sv        
 
 
 
þ
 
ÿÿ
ÿ
ÿ
ÿ
 
 
%"ÿ Eÿ