zmc
2023-12-22 9fdbf60165db0400c2e8e6be2dc6e88138ac719a
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
U
P±dGã@sndZddlmZmZmZmZmZmZmZm    Z    m
Z
m Z m Z m Z mZmZmZmZmZmZmZmZmZmZmZmZmZmZmZGdd„dƒZedkrjeedƒdƒZeeƒZ e!e"e ƒƒe!ee ƒe jƒe dd    …dd
…fZ#e!e#ƒd e#d <e!e#d e d ƒe!ee#ƒd dee#dƒƒe!ee#dƒe$ee#dƒƒƒe!e$e#eedƒee#ƒƒƒƒe!ee#dƒƒe!ee#ƒƒdS)z
Standard container-class for easy multiple-inheritance.
 
Try to inherit from the ndarray instead of using this class as this is not
complete.
 
é)ÚarrayÚasarrayÚabsoluteÚaddÚsubtractÚmultiplyÚdivideÚ    remainderÚpowerÚ
left_shiftÚ right_shiftÚ bitwise_andÚ
bitwise_orÚ bitwise_xorÚinvertÚlessÚ
less_equalÚ    not_equalÚequalÚgreaterÚ greater_equalÚshapeÚreshapeÚarangeÚsinÚsqrtÚ    transposec@seZdZdZd„dd„Zdd„Zd…dd    „Zd
d „Zd d „Zdd„Z    dd„Z
dd„Z dd„Z e Z dd„Zdd„Zdd„Zdd„Zdd„ZeZd d!„Zd"d#„Zd$d%„Zd&d'„Zd(d)„Zd*d+„Zd,d-„Zd.d/„Zd0d1„Zd2d3„Zd4d5„Zd6d7„Zd8d9„Z d:d;„Z!d<d=„Z"d>d?„Z#d@dA„Z$dBdC„Z%dDdE„Z&dFdG„Z'dHdI„Z(dJdK„Z)dLdM„Z*dNdO„Z+dPdQ„Z,dRdS„Z-dTdU„Z.dVdW„Z/dXdY„Z0dZd[„Z1d\d]„Z2d^d_„Z3d`da„Z4dbdc„Z5ddde„Z6dfdg„Z7dhdi„Z8djdk„Z9dldm„Z:dndo„Z;dpdq„Z<drds„Z=dtdu„Z>dvdw„Z?dxdy„Z@dzd{„ZAd|d}„ZBd~d„ZCd€d„ZDd‚dƒ„ZEdS)†Ú    containerzµ
    container(data, dtype=None, copy=True)
 
    Standard container-class for easy multiple-inheritance.
 
    Methods
    -------
    copy
    tostring
    byteswap
    astype
 
    NTcCst|||d|_dS)N)Úcopy)r)ÚselfÚdataÚdtyper©r"úKd:\z\workplace\vscode\pyvenv\venv\Lib\site-packages\numpy/lib/user_array.pyÚ__init__szcontainer.__init__cCsF|jdkr(|jjt|jƒtdƒd…S|jjdt|jƒdSdS)Nrrú(ú))ÚndimÚ    __class__Ú__name__ÚreprrÚlen©rr"r"r#Ú__repr__!s
zcontainer.__repr__cCs|r|j |¡S|jS©N)rÚastype)rÚtr"r"r#Ú    __array__'s zcontainer.__array__cCs
t|jƒSr.)r+rr,r"r"r#Ú__len__-szcontainer.__len__cCs| |j|¡Sr.©Ú_rcr)rÚindexr"r"r#Ú __getitem__0szcontainer.__getitem__cCst||jƒ|j|<dSr.)rr!r)rr5Úvaluer"r"r#Ú __setitem__3szcontainer.__setitem__cCs| t|jƒ¡Sr.)r4rrr,r"r"r#Ú__abs__6szcontainer.__abs__cCs| |j ¡Sr.r3r,r"r"r#Ú__neg__9szcontainer.__neg__cCs| |jt|ƒ¡Sr.©r4rr©rÚotherr"r"r#Ú__add__<szcontainer.__add__cCst|j||jƒ|Sr.)rrr<r"r"r#Ú__iadd__Aszcontainer.__iadd__cCs| |jt|ƒ¡Sr.r;r<r"r"r#Ú__sub__Eszcontainer.__sub__cCs| t|ƒ|j¡Sr.)r4rrr<r"r"r#Ú__rsub__Hszcontainer.__rsub__cCst|j||jƒ|Sr.)rrr<r"r"r#Ú__isub__Kszcontainer.__isub__cCs| t|jt|ƒƒ¡Sr.)r4rrrr<r"r"r#Ú__mul__Oszcontainer.__mul__cCst|j||jƒ|Sr.)rrr<r"r"r#Ú__imul__Tszcontainer.__imul__cCs| t|jt|ƒƒ¡Sr.)r4rrrr<r"r"r#Ú__div__Xszcontainer.__div__cCs| tt|ƒ|jƒ¡Sr.)r4rrrr<r"r"r#Ú__rdiv__[szcontainer.__rdiv__cCst|j||jƒ|Sr.)rrr<r"r"r#Ú__idiv__^szcontainer.__idiv__cCs| t|j|ƒ¡Sr.©r4r    rr<r"r"r#Ú__mod__bszcontainer.__mod__cCs| t||jƒ¡Sr.rHr<r"r"r#Ú__rmod__eszcontainer.__rmod__cCst|j||jƒ|Sr.)r    rr<r"r"r#Ú__imod__hszcontainer.__imod__cCs$| t|j|ƒ¡| t|j|ƒ¡fSr.©r4rrr    r<r"r"r#Ú
__divmod__lsÿzcontainer.__divmod__cCs$| t||jƒ¡| t||jƒ¡fSr.rLr<r"r"r#Ú __rdivmod__psÿzcontainer.__rdivmod__cCs| t|jt|ƒƒ¡Sr.)r4r
rrr<r"r"r#Ú__pow__tszcontainer.__pow__cCs| tt|ƒ|jƒ¡Sr.)r4r
rrr<r"r"r#Ú__rpow__wszcontainer.__rpow__cCst|j||jƒ|Sr.)r
rr<r"r"r#Ú__ipow__zszcontainer.__ipow__cCs| t|j|ƒ¡Sr.©r4r rr<r"r"r#Ú
__lshift__~szcontainer.__lshift__cCs| t|j|ƒ¡Sr.©r4r rr<r"r"r#Ú
__rshift__szcontainer.__rshift__cCs| t||jƒ¡Sr.rRr<r"r"r#Ú __rlshift__„szcontainer.__rlshift__cCs| t||jƒ¡Sr.rTr<r"r"r#Ú __rrshift__‡szcontainer.__rrshift__cCst|j||jƒ|Sr.)r rr<r"r"r#Ú __ilshift__Šszcontainer.__ilshift__cCst|j||jƒ|Sr.)r rr<r"r"r#Ú __irshift__Žszcontainer.__irshift__cCs| t|j|ƒ¡Sr.©r4r rr<r"r"r#Ú__and__’szcontainer.__and__cCs| t||jƒ¡Sr.rZr<r"r"r#Ú__rand__•szcontainer.__rand__cCst|j||jƒ|Sr.)r rr<r"r"r#Ú__iand__˜szcontainer.__iand__cCs| t|j|ƒ¡Sr.©r4rrr<r"r"r#Ú__xor__œszcontainer.__xor__cCs| t||jƒ¡Sr.r^r<r"r"r#Ú__rxor__Ÿszcontainer.__rxor__cCst|j||jƒ|Sr.)rrr<r"r"r#Ú__ixor__¢szcontainer.__ixor__cCs| t|j|ƒ¡Sr.©r4rrr<r"r"r#Ú__or__¦szcontainer.__or__cCs| t||jƒ¡Sr.rbr<r"r"r#Ú__ror__©szcontainer.__ror__cCst|j||jƒ|Sr.)rrr<r"r"r#Ú__ior__¬szcontainer.__ior__cCs | |j¡Sr.r3r,r"r"r#Ú__pos__°szcontainer.__pos__cCs| t|jƒ¡Sr.)r4rrr,r"r"r#Ú
__invert__³szcontainer.__invert__cCs"|jdkr||dƒStdƒ‚dS)Nrz6only rank-0 arrays can be converted to Python scalars.)r'Ú    TypeError)rÚfuncr"r"r#Ú _scalarfunc¶s
 
 ÿzcontainer._scalarfunccCs
| t¡Sr.)rjÚcomplexr,r"r"r#Ú __complex__½szcontainer.__complex__cCs
| t¡Sr.)rjÚfloatr,r"r"r#Ú    __float__Àszcontainer.__float__cCs
| t¡Sr.)rjÚintr,r"r"r#Ú__int__Ãszcontainer.__int__cCs
| t¡Sr.)rjÚhexr,r"r"r#Ú__hex__Æszcontainer.__hex__cCs
| t¡Sr.)rjÚoctr,r"r"r#Ú__oct__Észcontainer.__oct__cCs| t|j|ƒ¡Sr.)r4rrr<r"r"r#Ú__lt__Ìszcontainer.__lt__cCs| t|j|ƒ¡Sr.)r4rrr<r"r"r#Ú__le__Ïszcontainer.__le__cCs| t|j|ƒ¡Sr.)r4rrr<r"r"r#Ú__eq__Òszcontainer.__eq__cCs| t|j|ƒ¡Sr.)r4rrr<r"r"r#Ú__ne__Õszcontainer.__ne__cCs| t|j|ƒ¡Sr.)r4rrr<r"r"r#Ú__gt__Øszcontainer.__gt__cCs| t|j|ƒ¡Sr.)r4rrr<r"r"r#Ú__ge__Ûszcontainer.__ge__cCs| |j ¡¡S©Ú)r4rrr,r"r"r#rÞszcontainer.copycCs
|j ¡Sr{)rÚtostringr,r"r"r#r}âszcontainer.tostringcCs
|j ¡Sr{)rÚtobytesr,r"r"r#r~æszcontainer.tobytescCs| |j ¡¡Sr{)r4rÚbyteswapr,r"r"r#rêszcontainer.byteswapcCs| |j |¡¡Sr{)r4rr/)rÚtypecoder"r"r#r/îszcontainer.astypecCs"tt|ƒƒdkr|S| |¡SdS©Nr)r+rr()rÚar"r"r#r4òsz container._rccGs| |d¡Sr)r()rÚargsr"r"r#Ú__array_wrap__øszcontainer.__array_wrap__cCsT|dkrt |||¡dSz|j ||¡Wn"tk
rNt |||¡YnXdS©Nr)ÚobjectÚ __setattr__rÚAttributeError)rÚattrr7r"r"r#r‡ûszcontainer.__setattr__cCs |dkrt ||¡S|j |¡Sr…)r†Ú__getattribute__r)rr‰r"r"r#Ú __getattr__s zcontainer.__getattr__)NT)N)Fr)Ú
__module__Ú __qualname__Ú__doc__r$r-r1r2r6r8r9r:r>Ú__radd__r?r@rArBrCÚ__rmul__rDrErFrGrIrJrKrMrNrOrPrQrSrUrVrWrXrYr[r\r]r_r`rarcrdrerfrgrjrlrnrprrrtrurvrwrxryrzrr}r~rr/r4r„r‡r‹r"r"r"r#rs†
 
 
rÚ__main__i')édr’Nééé
)rrg@g@éégé)r”r“)%rŽZ
numpy.corerrrrrrrr    r
r r r rrrrrrrrrrrrrrrrr)ÚtempZuaÚprintÚdirZua_smallÚtyper"r"r"r#Ú<module>s"t~