§ <ˆj¯âãóX —ddlZddlZddlZddlZddlZddlmZddlZ ddl m cm Z ddlmZddl mZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZddl m!Z!m"Z"m#Z#m$Z$m%Z%m&Z&m'Z'm(Z(m)Z)m*Z*m+Z+m,Z,ddl-m.Z.m/Z/m0Z0m1Z1m2Z2m3Z3ddl4m5Z5dd lm6Z6dd l7m8Z8dd l9m:Z:dd l;mZ>m?Z?m@Z@mAZBmCZDdd l mEZFddlGZGddlHmIZImJZJejKe6jLd¬¦«ZLgd¢ZMeNeNd„d„¬¦«eNd„d„¬¦«eNd„d„¬¦«eNd„d„¬¦«eNd„d„¬¦«eNd„d„¬¦«eNd„d „¬¦«eNd!„d"„¬¦«eNd#„d$„¬¦«eNd%„d&„¬¦«eNd'„d(„¬¦«eNd)„d*„¬¦«eNd+„d,„¬¦«¬-¦ « ZOd«d.„ZPeLeP¦«d¬d1„¦«ZQd­d2„ZReLeR¦«d­d3„¦«ZSed¦«d4„¦«ZTd®dd5œd6„ZUeLeU¦«d¯e jVd5œd8„¦«ZWed¦«d«d9„¦«ZXd:„ZYeLeY¦«d;„¦«ZZd­d<„Z[eLe[¦«d°d=„¦«Z\d«d>„Z]eLe]¦«d±d@„¦«Z^dddAœdB„Z_eLe_¦«dd/dAœdC„¦«Z`d²dD„ZaeLea¦«d/dEe jVe jVfdF„¦«Zbd®dG„ZceLec¦«d®dH„¦«ZAd­dI„ZdeLed¦«d³dJ„¦«Zed«ddKœdL„ZfeLef¦«d´de!zdKœdM„¦«ZgdN„ZheLeh¦«dO„¦«Zid­dP„ZjeLej¦«dµdR„¦«ZkdS„ZleLel¦«dT„¦«ZmdU„ZneLen¦«dV„¦«Zod¶dX„ZpdYZqdZ req¦«Zsd[ res¦«Ztd\ ret¦«Zud] reu¦«Zvd^„Zwd_„Zxd`„Zyda„Zz d­db„Z{ed¦«Gdc„dd¦«¦«Z| d·ddeœdf„Z}eLe}¦« d¸ddeœdg„¦«Z~d²ddeœdh„ZeLe¦«ddWe jVe jVfddeœdi„¦«Z€ed¦«dj„¦«Z�ed¦«dk„¦«Z‚ed¦«dl„¦«Zƒed¦«dm„¦«Z„gdn¢Z…gdo¢Z†dp„Z‡dq„Zˆdr„Z‰ds„ZŠeLeЦ«dt„¦«Z‹ed¦«du„¦«ZŒdv„Z�eLe�¦«dw„¦«ZŽdx„Z�eLe�¦«dy„¦«Z�d³dz„Z‘ d²d{„Z’eLe’¦«d¹d|„¦«Z“d¯d}„Z” dºdd~œd„Z•eLe•¦« d»dd~œd�„¦«Z– dºdd~œd‚„Z—eLe—¦« d»dd~œdƒ„¦«Z˜ d»d„„Z™d…„Zšd†„Z›d‡eœdˆeœfd‰„Z�dŠ„Zžd­d‹„ZŸdŒ„Z d�„Z¡dŽ„Z¢d�„Z£ d¼d�e jd‘e jd’e¤d“e¥d”e jf d•„Z¦d–„Z§ d½d—e jd˜e jd’e¤fd™„Z¨d®dš„Z©eLe©¦«d¾dœ„¦«Zªe«eªd�¦«rJ‚d¾dž„Z¬e¬j­eª_­e¬j®eª_®e¬j¯eª_¯e¬j°eª_°e¬j±eª_±ddddŸœd „Z²eLe²¦«dWd7d¡dŸœd¢„¦«Z³d­d£„Z´eLe´¦«d­d¤„¦«Zµd­d¥„Z¶eLe¶¦«d­d¦„¦«Z·d­d§„Z¸eLe¸¦«d­d¨„¦«Z¹d­d©„ZºeLeº¦«d³dª„¦«Z»dS)¿éNé)Ú set_module)Ú transpose)ÚonesÚ zeros_likeÚarangeÚ concatenateÚarrayÚasarrayÚ asanyarrayÚemptyÚndarrayÚtakeÚdotÚwhereÚintpÚintegerÚisscalarÚabsolute) ÚpiÚaddÚarctan2Ú frompyfuncÚcosÚ less_equalÚsqrtÚsinÚmodÚexpÚ not_equalÚsubtract)ÚravelÚnonzeroÚ partitionÚmeanÚanyÚsum)Ú typecodes)Ú overrides)Ú add_newdoc)Údiag)Ú_placeÚ add_docstringÚbincountÚnormalize_axis_indexÚ _monotonicityÚinterpÚinterp_complex)Ú_add_newdoc_ufunc)Ú histogramÚ histogramddÚnumpy)Úmodule)*ÚselectÚ piecewiseÚ trim_zerosÚcopyÚiterableÚ percentileÚdiffÚgradientÚangleÚunwrapÚ sort_complexÚdispÚflipÚrot90ÚextractÚplaceÚ vectorizeÚasarray_chkfiniteÚaverager.ÚdigitizeÚcovÚcorrcoefÚmsortÚmedianÚsincÚhammingÚhanningÚbartlettÚblackmanÚkaiserÚtrapzÚi0r*r-ÚmeshgridÚdeleteÚinsertÚappendr1Úadd_newdoc_ufuncÚquantilecó"—t||¦«S©N)Ú _inverted_cdf©ÚnÚ quantiless úN/opt/cloudlinux/venv/lib64/python3.11/site-packages/numpy/lib/function_base.pyúreIs€­}¸QÀ Ñ/JÔ/J€ócó—|Sr_©©ÚgammaÚ_s rdrereJó€ 5€rf)Úget_virtual_indexÚ fix_gammacó—||zdz S©Nérhras rdrereMs€°°I± ÀÑ/B€rfcó:—t|jdd|dk¬¦«S)Nçð?çà?r©ÚshapeÚ default_valueÚconditioned_valuer©Ú_get_gamma_maskrvris rdrereNs'€¥?Ø”+ØØ!ؘ1’*ð $ñ$ô$€rfcó"—t||¦«Sr_)Ú_closest_observationras rdrereUs€Õ/CÀAØDMñ0Oô0O€rfcó—|Sr_rhris rdrereWrlrfcó&—t||dd¦«S)Nrrq©Ú_compute_virtual_indexras rdrere[ó€Ý˜q )¨Q°Ñ2Ô2ðrfcó—|Sr_rhris rdrere]rlrfcó&—t||dd¦«S)Nrtrras rdrere`s€Ý˜q )¨S°#Ñ6Ô6ðrfcó—|Sr_rhris rdrerebrlrfcó&—t||dd¦«S©Nrrras rdrereer�rfcó—|Sr_rhris rdreregrlrfcó—|dz |zSrprhras rdrerens€°°A±¸Ñ/B€rfcó—|Sr_rhris rdrereorlrfcó&—t||dd¦«S)NgUUUUUUÕ?rras rdrereró€Ý˜q )¨W°gÑ>Ô>ðrfcó—|Sr_rhris rdreretrlrfcó&—t||dd¦«S)NgØ?rras rdrerewr‹rfcó—|Sr_rhris rdrereyrlrfcóp—tj|dz |z¦« tj¦«Srp)ÚnpÚfloorÚastyperras rdrere}s.€­r¬xØ �‰U�iÑ ñ0!ô0!ß!'¢­¬¡¤ðrfcó—|Sr_rhris rdrererlrfcóp—tj|dz |z¦« tj¦«Srp)r�Úceilr’rras rdrereƒs.€­r¬wØ �‰U�iÑ ñ0!ô0!ß!'¢­¬¡¤ðrfcó—|Sr_rhris rdrere…rlrfcór—dtj|dz |z¦«tj|dz |z¦«zzS)Nrtrq)r�r‘r•ras rdrere‰s<€¨sÝ”˜!˜a™% 9Ñ,Ñ-Ô-Ý”'˜1˜q™5 IÑ-Ñ.Ô.ñ/ñ00€rfcó@—t|jdd|dzdk¬¦«S)Nrtçrqrrury©rjÚindexs rdrereŒs+€¥Ø”+ØØ ؘ!‘)˜q’.ð ("ñ("ô("€rfcóp—tj|dz |z¦« tj¦«Srp)r�Úaroundr’rras rdrere“s.€­r¬yØ �‰U�iÑ ñ0!ô0!ß!'¢­¬¡¤ðrfcó—|Sr_rhris rdrere•rlrf) Ú inverted_cdfÚaveraged_inverted_cdfÚclosest_observationÚinterpolated_inverted_cdfÚhazenÚweibullÚlinearÚmedian_unbiasedÚnormal_unbiasedÚlowerÚhigherÚmidpointÚnearestcó—|fSr_rh)ÚmÚkÚaxess rdÚ_rot90_dispatcherr°šó €Ø ˆ4€Krfrq©rrqcóœ—t|¦«}t|¦«dkrtd¦«‚t|¦«}|d|dks't |d|dz ¦«|jkrtd¦«‚|d|jks5|d|j ks#|d|jks|d|j kr(td ||j¦«¦«‚|dz}|dkr |dd…S|dkr*tt||d¦«|d¦«Std|j¦«}||d||dc||d<||d<|dkr$tt||d¦«|¦«Stt||¦«|d¦«S) a‚ Rotate an array by 90 degrees in the plane specified by axes. Rotation direction is from the first towards the second axis. This means for a 2D array with the default `k` and `axes`, the rotation will be counterclockwise. Parameters ---------- m : array_like Array of two or more dimensions. k : integer Number of times the array is rotated by 90 degrees. axes : (2,) array_like The array is rotated in the plane defined by the axes. Axes must be different. .. versionadded:: 1.12.0 Returns ------- y : ndarray A rotated view of `m`. See Also -------- flip : Reverse the order of elements in an array along the given axis. fliplr : Flip an array horizontally. flipud : Flip an array vertically. Notes ----- ``rot90(m, k=1, axes=(1,0))`` is the reverse of ``rot90(m, k=1, axes=(0,1))`` ``rot90(m, k=1, axes=(1,0))`` is equivalent to ``rot90(m, k=-1, axes=(0,1))`` Examples -------- >>> m = np.array([[1,2],[3,4]], int) >>> m array([[1, 2], [3, 4]]) >>> np.rot90(m) array([[2, 4], [1, 3]]) >>> np.rot90(m, 2) array([[4, 3], [2, 1]]) >>> m = np.arange(8).reshape((2,2,2)) >>> np.rot90(m, 1, (1,2)) array([[[1, 3], [0, 2]], [[5, 7], [4, 6]]]) rzlen(axes) must be 2.rrqzAxes must be different.z*Axes={} out of range for array of ndim={}.éN) ÚtupleÚlenÚ ValueErrorr rÚndimÚformatrDrr)r­r®r¯Ú axes_lists rdrErEžsÁ€õx �‰;Œ;€DÝ ˆ4�y„y�A‚~€~ÝÐ/Ñ0Ô0Ð0å�1‰ Œ €Aà ˆA„w�$�q”'ÒÐ�X d¨1¤g°°Q´Ñ&7Ñ8Ô8¸A¼FÒBÐBÝÐ2Ñ3Ô3Ð3à ˆQŒ�1”6ÒИT !œW¨¬ wÒ.Ð.Ø �Œ7�a”fÒ Ð   Q¤¨1¬6¨'Ò 1Ð 1ÝÐEß ŠV�D˜!œ&Ñ !Ô !ñ#ô#ð #ðˆ�F€AàˆA‚v€vØ���Œtˆ ؈A‚v€vÝ•D˜˜D œGÑ$Ô$ d¨1¤gÑ.Ô.Ð.å�q˜!œ&Ñ!Ô!€IØ09¸$¸q¼'Ô0BØ09¸$¸q¼'Ô0Bð-€Yˆt�AŒwј 4¨¤7Ñ+ð ˆA‚v€vÝ�˜a  a¤Ñ)Ô)¨9Ñ5Ô5Ð5õ•I˜a Ñ+Ô+¨T°!¬WÑ5Ô5Ð5rfcó—|fSr_rh)r­Úaxiss rdÚ_flip_dispatcherr½úr±rfcóX—t|d¦«st|¦«}|€tjddd…f|jz}nct j||j¦«}tjdd…g|jz}|D]}tjddd…||<Œt|¦«}||S)a Reverse the order of elements in an array along the given axis. The shape of the array is preserved, but the elements are reordered. .. versionadded:: 1.12.0 Parameters ---------- m : array_like Input array. axis : None or int or tuple of ints, optional Axis or axes along which to flip over. The default, axis=None, will flip over all of the axes of the input array. If axis is negative it counts from the last to the first axis. If axis is a tuple of ints, flipping is performed on all of the axes specified in the tuple. .. versionchanged:: 1.15.0 None and tuples of axes are supported Returns ------- out : array_like A view of `m` with the entries of axis reversed. Since a view is returned, this operation is done in constant time. See Also -------- flipud : Flip an array vertically (axis=0). fliplr : Flip an array horizontally (axis=1). Notes ----- flip(m, 0) is equivalent to flipud(m). flip(m, 1) is equivalent to fliplr(m). flip(m, n) corresponds to ``m[...,::-1,...]`` with ``::-1`` at position n. flip(m) corresponds to ``m[::-1,::-1,...,::-1]`` with ``::-1`` at all positions. flip(m, (0, 1)) corresponds to ``m[::-1,::-1,...]`` with ``::-1`` at position 0 and position 1. Examples -------- >>> A = np.arange(8).reshape((2,2,2)) >>> A array([[[0, 1], [2, 3]], [[4, 5], [6, 7]]]) >>> np.flip(A, 0) array([[[4, 5], [6, 7]], [[0, 1], [2, 3]]]) >>> np.flip(A, 1) array([[[2, 3], [0, 1]], [[6, 7], [4, 5]]]) >>> np.flip(A) array([[[7, 6], [5, 4]], [[3, 2], [1, 0]]]) >>> np.flip(A, (0, 2)) array([[[5, 4], [7, 6]], [[1, 0], [3, 2]]]) >>> A = np.random.randn(3,4,5) >>> np.all(np.flip(A,2) == A[:,:,::-1,...]) True r¸Néÿÿÿÿ)Úhasattrr r�Ús_r¸Ú_nxÚnormalize_axis_tuplerµ)r­r¼ÚindexerÚaxs rdrDrDþsª€õb �1�fÑ Ô ðÝ �A‰JŒJˆØ €|Ý”5˜˜˜2˜”;�. 1¤6Ñ)ˆˆåÔ'¨¨a¬fÑ5Ô5ˆÝ”5˜˜˜”8�*˜qœvÑ%ˆØð &ð &ˆBÝœ%   " œ+ˆG�B‰KˆKݘ‘.”.ˆØ ˆWŒ:ÐrfcóJ— t|¦«n#t$rYdSwxYwdS)a Check whether or not an object can be iterated over. Parameters ---------- y : object Input object. Returns ------- b : bool Return ``True`` if the object has an iterator method or is a sequence and ``False`` otherwise. Examples -------- >>> np.iterable([1, 2, 3]) True >>> np.iterable(2) False Notes ----- In most cases, the results of ``np.iterable(obj)`` are consistent with ``isinstance(obj, collections.abc.Iterable)``. One notable exception is the treatment of 0-dimensional arrays:: >>> from collections.abc import Iterable >>> a = np.array(1.0) # 0-dimensional numpy array >>> isinstance(a, Iterable) True >>> np.iterable(a) False FT)ÚiterÚ TypeError)Úys rdr<r<\s<€ðLÝ ˆQ‰ŒˆˆøÝ ððð؈uˆuðøøøà ˆ4s ‚’ Ÿ )Úkeepdimscó —||fSr_rh)Úar¼ÚweightsÚreturnedrÊs rdÚ_average_dispatcherrωs €à ˆwˆ<ÐrfFcó„—tj|¦«}|tjuri}nd|i}|€K|j|fi|¤Ž}tj|¦«}|j |j|jz ¦«}�n‡tj|¦«} t|jjtjtj f¦«r!tj |j| jd¦«} ntj |j| j¦«} |j | j kr”|€td¦«‚| j dkrtd¦«‚| j d|j |krtd¦«‚tj| |j dz d z| j z¦«} |  d |¦«} | jd|| d œ|¤Ž}tj|d k¦«rt'd ¦«‚tj|| | ¬¦«j|fi|¤Ž|z x}}|r@|j |j kr,tj||j ¦« ¦«}||fS|S)a± Compute the weighted average along the specified axis. Parameters ---------- a : array_like Array containing data to be averaged. If `a` is not an array, a conversion is attempted. axis : None or int or tuple of ints, optional Axis or axes along which to average `a`. The default, axis=None, will average over all of the elements of the input array. If axis is negative it counts from the last to the first axis. .. versionadded:: 1.7.0 If axis is a tuple of ints, averaging is performed on all of the axes specified in the tuple instead of a single axis or all the axes as before. weights : array_like, optional An array of weights associated with the values in `a`. Each value in `a` contributes to the average according to its associated weight. The weights array can either be 1-D (in which case its length must be the size of `a` along the given axis) or of the same shape as `a`. If `weights=None`, then all data in `a` are assumed to have a weight equal to one. The 1-D calculation is:: avg = sum(a * weights) / sum(weights) The only constraint on `weights` is that `sum(weights)` must not be 0. returned : bool, optional Default is `False`. If `True`, the tuple (`average`, `sum_of_weights`) is returned, otherwise only the average is returned. If `weights=None`, `sum_of_weights` is equivalent to the number of elements over which the average is taken. keepdims : bool, optional If this is set to True, the axes which are reduced are left in the result as dimensions with size one. With this option, the result will broadcast correctly against the original `a`. *Note:* `keepdims` will not work with instances of `numpy.matrix` or other classes whose methods do not support `keepdims`. .. versionadded:: 1.23.0 Returns ------- retval, [sum_of_weights] : array_type or double Return the average along the specified axis. When `returned` is `True`, return a tuple with the average as the first element and the sum of the weights as the second element. `sum_of_weights` is of the same type as `retval`. The result dtype follows a genereal pattern. If `weights` is None, the result dtype will be that of `a` , or ``float64`` if `a` is integral. Otherwise, if `weights` is not None and `a` is non- integral, the result type will be the type of lowest precision capable of representing values of both `a` and `weights`. If `a` happens to be integral, the previous rules still applies but the result dtype will at least be ``float64``. Raises ------ ZeroDivisionError When all weights along axis are zero. See `numpy.ma.average` for a version robust to this type of error. TypeError When the length of 1D `weights` is not the same as the shape of `a` along axis. See Also -------- mean ma.average : average for masked arrays -- useful if your data contains "missing" values numpy.result_type : Returns the type that results from applying the numpy type promotion rules to the arguments. Examples -------- >>> data = np.arange(1, 5) >>> data array([1, 2, 3, 4]) >>> np.average(data) 2.5 >>> np.average(np.arange(1, 11), weights=np.arange(10, 0, -1)) 4.0 >>> data = np.arange(6).reshape((3, 2)) >>> data array([[0, 1], [2, 3], [4, 5]]) >>> np.average(data, axis=1, weights=[1./4, 3./4]) array([0.75, 2.75, 4.75]) >>> np.average(data, weights=[1./4, 3./4]) Traceback (most recent call last): ... TypeError: Axis must be specified when shapes of a and weights differ. >>> a = np.ones(5, dtype=np.float128) >>> w = np.ones(5, dtype=np.complex64) >>> avg = np.average(a, weights=w) >>> print(avg.dtype) complex256 With ``keepdims=True``, the following result has shape (3, 1). >>> np.average(data, axis=1, keepdims=True) array([[0.5], [2.5], [4.5]]) rÊNÚf8z;Axis must be specified when shapes of a and weights differ.rqz81D weights expected when shapes of a and weights differ.rz5Length of weights not compatible with specified axis.©rqr¿)r¼Údtyper™z(Weights sum to zero, can't be normalized©rÓrh)r�r Ú_NoValuer%rÓÚtypeÚsizeÚ issubclassrÚbool_Ú result_typervrÈr¸r·Ú broadcast_toÚswapaxesr'r&ÚZeroDivisionErrorÚmultiplyr;) rÌr¼rÍrÎrÊÚ keepdims_kwÚavgÚ avg_as_arrayÚsclÚwgtÚ result_dtypes rdrJrJŽsx€õb Œ �aÑÔ€Aà•2”;ÐÐàˆ ˆ à! 8Ð,ˆ à€ØˆaŒf�TÐ)Ð)˜[Ð)Ð)ˆÝ”} SÑ)Ô)ˆ ØÔ ×%Ò% a¤f¨\Ô->Ñ&>Ñ?Ô?ˆ‰åŒm˜GÑ$Ô$ˆå �a”g”l¥R¤Zµ´Ð$:Ñ ;Ô ;ð >Ýœ>¨!¬'°3´9¸dÑCÔCˆLˆLåœ>¨!¬'°3´9Ñ=Ô=ˆLð Œ7�c”iÒ Ð Øˆ|ÝðñôððŒx˜1Š}ˆ}ÝØNñPôPðPàŒy˜Œ|˜qœw tœ}Ò,Ð,Ý ØKñMôMðMõ”/ #¨¬¨q©°$¡¸¼Ñ'BÑCÔCˆCØ—,’,˜r 4Ñ(Ô(ˆCàˆcŒgÐC˜4 |ÐCÐC°{ÐCÐCˆÝ Œ6�#˜’*Ñ Ô ð <Ý#Ø:ñ<ô<ð <ð2�Rœ[¨¨CØ ,ð.ñ.ô.Ü.1°$ðGðGØ:EðGðGØILñMð MˆˆlððØ Œ9˜ Ô*Ò *Ð *Ý”/ # |Ô'9Ñ:Ô:×?Ò?ÑAÔAˆCØ�Cˆxˆàˆ rfcóÆ—t|||¬¦«}|jjtdvr5t j|¦« ¦«std¦«‚|S)a Convert the input to an array, checking for NaNs or Infs. Parameters ---------- a : array_like Input data, in any form that can be converted to an array. This includes lists, lists of tuples, tuples, tuples of tuples, tuples of lists and ndarrays. Success requires no NaNs or Infs. dtype : data-type, optional By default, the data-type is inferred from the input data. order : {'C', 'F', 'A', 'K'}, optional Memory layout. 'A' and 'K' depend on the order of input array a. 'C' row-major (C-style), 'F' column-major (Fortran-style) memory representation. 'A' (any) means 'F' if `a` is Fortran contiguous, 'C' otherwise 'K' (keep) preserve input order Defaults to 'C'. Returns ------- out : ndarray Array interpretation of `a`. No copy is performed if the input is already an ndarray. If `a` is a subclass of ndarray, a base class ndarray is returned. Raises ------ ValueError Raises ValueError if `a` contains NaN (Not a Number) or Inf (Infinity). See Also -------- asarray : Create and array. asanyarray : Similar function which passes through subclasses. ascontiguousarray : Convert input to a contiguous array. asfarray : Convert input to a floating point ndarray. asfortranarray : Convert input to an ndarray with column-major memory order. fromiter : Create an array from an iterator. fromfunction : Construct an array by executing a function on grid positions. Examples -------- Convert a list into an array. If all elements are finite ``asarray_chkfinite`` is identical to ``asarray``. >>> a = [1, 2] >>> np.asarray_chkfinite(a, dtype=float) array([1., 2.]) Raises ValueError if array_like contains Nans or Infs. >>> a = [1, 2, np.inf] >>> try: ... np.asarray_chkfinite(a) ... except ValueError: ... print('ValueError') ... ValueError )rÓÚorderÚAllFloatz#array must not contain infs or NaNs)r rÓÚcharr(r�ÚisfiniteÚallr·)rÌrÓræs rdrIrI4s`€õ@ �˜ eÐ,Ñ,Ô,€AØ„w„|•y Ô,Ð,Ð,µR´[À±^´^×5GÒ5GÑ5IÔ5IÐ,ÝØ 1ñ3ô3ð 3à €Hrfc/óNK—|V—tj|¦«r |Ed{V—†dSdSr_)r�r<)ÚxÚcondlistÚfunclistÚargsÚkws rdÚ_piecewise_dispatcherrñ{sIèè€Ø €G€G€Gå „{�8ÑÔðØÐÐÐÐÐÐÐÐÐððrfcóº—t|¦«}t|¦«}t|¦«s-t|dtt f¦«s|jdkr|g}t|t¬¦«}t|¦«}||dz kr6tj |dd¬¦«}tj ||gd¬¦«}|dz }n-||kr'td  |||dz¦«¦«‚t|¦«}t||¦«D]L\} } t| t jj¦«s| || <Œ*|| } | jdkr| | g|¢Ri|¤Ž|| <ŒM|S)a Evaluate a piecewise-defined function. Given a set of conditions and corresponding functions, evaluate each function on the input data wherever its condition is true. Parameters ---------- x : ndarray or scalar The input domain. condlist : list of bool arrays or bool scalars Each boolean array corresponds to a function in `funclist`. Wherever `condlist[i]` is True, `funclist[i](x)` is used as the output value. Each boolean array in `condlist` selects a piece of `x`, and should therefore be of the same shape as `x`. The length of `condlist` must correspond to that of `funclist`. If one extra function is given, i.e. if ``len(funclist) == len(condlist) + 1``, then that extra function is the default value, used wherever all conditions are false. funclist : list of callables, f(x,*args,**kw), or scalars Each function is evaluated over `x` wherever its corresponding condition is True. It should take a 1d array as input and give an 1d array or a scalar value as output. If, instead of a callable, a scalar is provided then a constant function (``lambda x: scalar``) is assumed. args : tuple, optional Any further arguments given to `piecewise` are passed to the functions upon execution, i.e., if called ``piecewise(..., ..., 1, 'a')``, then each function is called as ``f(x, 1, 'a')``. kw : dict, optional Keyword arguments used in calling `piecewise` are passed to the functions upon execution, i.e., if called ``piecewise(..., ..., alpha=1)``, then each function is called as ``f(x, alpha=1)``. Returns ------- out : ndarray The output is the same shape and type as x and is found by calling the functions in `funclist` on the appropriate portions of `x`, as defined by the boolean arrays in `condlist`. Portions not covered by any condition have a default value of 0. See Also -------- choose, select, where Notes ----- This is similar to choose or select, except that functions are evaluated on elements of `x` that satisfy the corresponding condition from `condlist`. The result is:: |-- |funclist[0](x[condlist[0]]) out = |funclist[1](x[condlist[1]]) |... |funclist[n2](x[condlist[n2]]) |-- Examples -------- Define the sigma function, which is -1 for ``x < 0`` and +1 for ``x >= 0``. >>> x = np.linspace(-2.5, 2.5, 6) >>> np.piecewise(x, [x < 0, x >= 0], [-1, 1]) array([-1., -1., -1., 1., 1., 1.]) Define the absolute value, which is ``-x`` for ``x <0`` and ``x`` for ``x >= 0``. >>> np.piecewise(x, [x < 0, x >= 0], [lambda x: -x, lambda x: x]) array([2.5, 1.5, 0.5, 0.5, 1.5, 2.5]) Apply the same function to a scalar value. >>> y = -2 >>> np.piecewise(y, [y < 0, y >= 0], [lambda x: -x, lambda x: x]) array(2) rrÔrqT)r¼rÊ©r¼z¼VÀqº[¸[Ø�:ˆå�x¥tÐ,Ñ,Ô,€HÝ ˆH‰ Œ €AàˆB�‰F‚{€{Ý”F˜8¨!°dÐ;Ñ;Ô;Ð;ˆÝ”> 8¨XÐ"6¸QÐ?Ñ?Ô?ˆØ ˆQ‰ˆˆØ ˆbŠˆÝØ Jß ŠV�A�q˜!˜A™#Ñ Ô ñ ô ð õ �1‰ Œ €Aݘ( HÑ-Ô-ð2ð2‰ ˆˆdݘ$¥ ¤Ô 8Ñ9Ô9ð 2؈Aˆd‰GˆGà�T”7ˆDØŒy˜1Š}ˆ}ؘ$˜tÐ1 dÐ1Ð1Ð1¨bÐ1Ð1��$‘øà €Hrfc#ó*K—|Ed{V—†|Ed{V—†dSr_rh)ríÚ choicelistÚdefaults rdÚ_select_dispatcherrûs<èè€ØÐÐÐÐÐÐÐØÐÐÐÐÐÐÐÐÐrfcó&—t|¦«t|¦«krtd¦«‚t|¦«dkrtd¦«‚d„|D¦«} tj|Ž}n'#t$r}d|›�}t |¦«d‚d}~wwxYwtj|¦«}| |¦« tj||¦«}n'#t$r}d|›�}t |¦«d‚d}~wwxYwtj|Ž}tj|Ž}t|¦«D]?\}} | j j tj ur"t d  |¦«¦«‚Œ@|dj dkr|dj} n,tj|d|d¦«dj} tj| |d |¦«} |d dd …}|ddd …}t!||¦«D]\} } tj| | | ¬ ¦«Œ| S) a9 Return an array drawn from elements in choicelist, depending on conditions. Parameters ---------- condlist : list of bool ndarrays The list of conditions which determine from which array in `choicelist` the output elements are taken. When multiple conditions are satisfied, the first one encountered in `condlist` is used. choicelist : list of ndarrays The list of arrays from which the output elements are taken. It has to be of the same length as `condlist`. default : scalar, optional The element inserted in `output` when all conditions evaluate to False. Returns ------- output : ndarray The output at position m is the m-th element of the array in `choicelist` where the m-th element of the corresponding array in `condlist` is True. See Also -------- where : Return elements from one of two arrays depending on condition. take, choose, compress, diag, diagonal Examples -------- >>> x = np.arange(6) >>> condlist = [x<3, x>3] >>> choicelist = [x, x**2] >>> np.select(condlist, choicelist, 42) array([ 0, 1, 2, 42, 16, 25]) >>> condlist = [x<=4, x>3] >>> choicelist = [x, x**2] >>> np.select(condlist, choicelist, 55) array([ 0, 1, 2, 3, 4, 25]) z7list of cases must be same length as list of conditionsrz3select with an empty condition list is not possiblecó6—g|]}tj|¦«‘ŒSrh)r�r )Ú.0Úchoices rdú zselect..4s"€Ð>Ð>Ð>¨•"”*˜VÑ$Ô$Ð>Ð>Ð>rfz0Choicelist elements do not have a common dtype: Nz:Choicelists and default value do not have a common dtype: z7invalid entry {} in condlist: should be boolean ndarrayr¿éþÿÿÿ©r)r¶r·r�rÚrÈr r[Úbroadcast_arraysÚ enumeraterÓrÖrÙr¹r¸rvÚfullr÷Úcopyto) rírrÚintermediate_dtypeÚeÚmsgÚ default_arrayrÓÚirýÚ result_shapeÚresultrs rdr8r8s`€õX ˆ8�}„}�˜J™œÒ'Ð'ÝØ EñGôGð Gõ ˆ8�}„}˜ÒÐÝÐNÑOÔOÐOà>Ð>°:Ð>Ñ>Ô>€Jð'Ýœ^¨ZÐ8ÐÐøÝ ð'ð'ð'ØDÀÐDÐDˆÝ˜‰nŒn $Ð&øøøøð'øøøõ”J˜wÑ'Ô'€MØ×Ò�mÑ$Ô$Ð$ð'Ý”Ð1°=ÑAÔAˆˆøÝ ð'ð'ð'ØNÈ1ÐNÐNˆÝ˜‰nŒn $Ð&øøøøð'øøøõÔ" HÐ-€HÝÔ$ jÐ1€Jõ˜XÑ&Ô&ðUðU‰ˆˆ4Ø Œ:Œ?¥"¤(Ð *Ð *ÝØI×PÒPÐQRÑSÔSñUôUð Uð +ð�!„}Ô˜QÒÐà ”{Ô(ˆ ˆ åÔ*¨8°A¬;¸ À1¼ ÑFÔFÀqÔIÔOˆ å ŒW�\ :¨b¤>°5Ñ 9Ô 9€Fð ˜B˜F ˜FÔ#€Jؘ˜˜"˜Œ~€HݘJ¨Ñ1Ô1ð.ð.‰ ˆ�Ý Œ �&˜&¨Ð-Ñ-Ô-Ð-Ð-à €Ms0ÁA.Á. BÁ8B  BÂ?Cà C9ÃC4Ã4C9có—|fSr_rh©rÌræÚsuboks rdÚ_copy_dispatcherrer±rfÚKcó(—t|||d¬¦«S)a- Return an array copy of the given object. Parameters ---------- a : array_like Input data. order : {'C', 'F', 'A', 'K'}, optional Controls the memory layout of the copy. 'C' means C-order, 'F' means F-order, 'A' means 'F' if `a` is Fortran contiguous, 'C' otherwise. 'K' means match the layout of `a` as closely as possible. (Note that this function and :meth:`ndarray.copy` are very similar, but have different default values for their order= arguments.) subok : bool, optional If True, then sub-classes will be passed-through, otherwise the returned array will be forced to be a base-class array (defaults to False). .. versionadded:: 1.19.0 Returns ------- arr : ndarray Array interpretation of `a`. See Also -------- ndarray.copy : Preferred method for creating an array copy Notes ----- This is equivalent to: >>> np.array(a, copy=True) #doctest: +SKIP Examples -------- Create an array x, with a reference y and a copy z: >>> x = np.array([1, 2, 3]) >>> y = x >>> z = np.copy(x) Note that, when we modify x, y changes, but not z: >>> x[0] = 10 >>> x[0] == y[0] True >>> x[0] == z[0] False Note that, np.copy clears previously set WRITEABLE=False flag. >>> a = np.array([1, 2, 3]) >>> a.flags["WRITEABLE"] = False >>> b = np.copy(a) >>> b.flags["WRITEABLE"] True >>> b[0] = 3 >>> b array([3, 2, 3]) Note that np.copy is a shallow copy and will not copy object elements within arrays. This is mainly important for arrays containing Python objects. The new array will contain the same object which may lead to surprises if that object can be modified (is mutable): >>> a = np.array([1, 'm', [2, 3, 4]], dtype=object) >>> b = np.copy(a) >>> b[2][0] = 10 >>> a array([1, 'm', list([10, 3, 4])], dtype=object) To ensure all elements within an ``object`` array are copied, use `copy.deepcopy`: >>> import copy >>> a = np.array([1, 'm', [2, 3, 4]], dtype=object) >>> c = copy.deepcopy(a) >>> c[2][0] = 10 >>> c array([1, 'm', list([10, 3, 4])], dtype=object) >>> a array([1, 'm', list([2, 3, 4])], dtype=object) T)rærr;)r rs rdr;r;is€õr �˜% u°4Ð 8Ñ 8Ô 8Ð8rf)r¼Ú edge_orderc'ó"K—|V—|Ed{V—†dSr_rh)Úfr¼rÚvarargss rdÚ_gradient_dispatcherr Çs-èè€Ø €G€G€GØÐÐÐÐÐÐÐÐÐrfcó—tj|¦«}|j}|€tt |¦«¦«}nt j||¦«}t|¦«}t|¦«}|dkrdg|z}�nU|dkr%tj|d¦«dkr||z}�n*||k�rt|¦«}t|¦«D]ô\} } tj| ¦«} | jdkrŒ%| jdkrtd¦«‚t| ¦«|j || krtd¦«‚tj | j tj¦«r|  tj¦«} tj| ¦«} | | dk ¦«r| d} | || <Œõnt'd¦«‚|dkrtd ¦«‚g} t)d¦«g|z} t)d¦«g|z}t)d¦«g|z}t)d¦«g|z}|j }|jtjurCtj |j d d ¦«¦«}| |¦«}n~|jtjurnjtj |tj¦«rnJtj |tj¦«r| tj¦«}tj}t9||¦«D�]4\}}|j ||dzkrtd ¦«‚tj||¬ ¦«}tj|¦«dk}t)dd¦«| |<t)dd¦«||<t)dd¦«||<t)dd¦«||<|rB|t|¦«|t|¦«z d|zz |t| ¦«<nÅ|dd…}|dd…}| |||zzz }||z ||zz }||||zzz }tj|t>¬ ¦«}d||<|x|_ x|_ |_ ||t|¦«z||t|¦«zz||t|¦«zz|t| ¦«<|dkr´d| |<d||<d||<|r|n|d}|t|¦«|t|¦«z |z |t| ¦«<d| |<d||<d||<|r|n|d}|t|¦«|t|¦«z |z |t| ¦«<�nqd| |<d||<d||<d||<|rd|z }d|z }d|z }n9|d}|d}d|z|z |||zzz }||z||zz }| |||zzz }||t|¦«z||t|¦«zz||t|¦«zz|t| ¦«<d| |<d||<d||<d||<|rd|z }d|z }d|z }n8|d}|d}||||zzz }||z ||zz }d|z|z|||zzz }||t|¦«z||t|¦«zz||t|¦«zz|t| ¦«<|   |¦«t)d¦«| |<t)d¦«||<t)d¦«||<t)d¦«||<�Œ6|dkr| dStj!¦«rt| ¦«S| S)a Return the gradient of an N-dimensional array. The gradient is computed using second order accurate central differences in the interior points and either first or second order accurate one-sides (forward or backwards) differences at the boundaries. The returned gradient hence has the same shape as the input array. Parameters ---------- f : array_like An N-dimensional array containing samples of a scalar function. varargs : list of scalar or array, optional Spacing between f values. Default unitary spacing for all dimensions. Spacing can be specified using: 1. single scalar to specify a sample distance for all dimensions. 2. N scalars to specify a constant sample distance for each dimension. i.e. `dx`, `dy`, `dz`, ... 3. N arrays to specify the coordinates of the values along each dimension of F. The length of the array must match the size of the corresponding dimension 4. Any combination of N scalars/arrays with the meaning of 2. and 3. If `axis` is given, the number of varargs must equal the number of axes. Default: 1. edge_order : {1, 2}, optional Gradient is calculated using N-th order accurate differences at the boundaries. Default: 1. .. versionadded:: 1.9.1 axis : None or int or tuple of ints, optional Gradient is calculated only along the given axis or axes The default (axis = None) is to calculate the gradient for all the axes of the input array. axis may be negative, in which case it counts from the last to the first axis. .. versionadded:: 1.11.0 Returns ------- gradient : ndarray or list of ndarray A list of ndarrays (or a single ndarray if there is only one dimension) corresponding to the derivatives of f with respect to each dimension. Each derivative has the same shape as f. Examples -------- >>> f = np.array([1, 2, 4, 7, 11, 16], dtype=float) >>> np.gradient(f) array([1. , 1.5, 2.5, 3.5, 4.5, 5. ]) >>> np.gradient(f, 2) array([0.5 , 0.75, 1.25, 1.75, 2.25, 2.5 ]) Spacing can be also specified with an array that represents the coordinates of the values F along the dimensions. For instance a uniform spacing: >>> x = np.arange(f.size) >>> np.gradient(f, x) array([1. , 1.5, 2.5, 3.5, 4.5, 5. ]) Or a non uniform one: >>> x = np.array([0., 1., 1.5, 3.5, 4., 6.], dtype=float) >>> np.gradient(f, x) array([1. , 3. , 3.5, 6.7, 6.9, 2.5]) For two dimensional arrays, the return will be two arrays ordered by axis. In this example the first array stands for the gradient in rows and the second one in columns direction: >>> np.gradient(np.array([[1, 2, 6], [3, 4, 5]], dtype=float)) [array([[ 2., 2., -1.], [ 2., 2., -1.]]), array([[1. , 2.5, 4. ], [1. , 1. , 1. ]])] In this example the spacing is also specified: uniform for axis=0 and non uniform for axis=1 >>> dx = 2. >>> y = [1., 1.5, 3.5] >>> np.gradient(np.array([[1, 2, 6], [3, 4, 5]], dtype=float), dx, y) [array([[ 1. , 1. , -0.5], [ 1. , 1. , -0.5]]), array([[2. , 2. , 2. ], [2. , 1.7, 0.5]])] It is possible to specify how boundaries are treated using `edge_order` >>> x = np.array([0, 1, 2, 3, 4]) >>> f = x**2 >>> np.gradient(f, edge_order=1) array([1., 2., 4., 6., 7.]) >>> np.gradient(f, edge_order=2) array([0., 2., 4., 6., 8.]) The `axis` keyword can be used to specify a subset of axes of which the gradient is calculated >>> np.gradient(np.array([[1, 2, 6], [3, 4, 5]], dtype=float), axis=0) array([[ 2., 2., -1.], [ 2., 2., -1.]]) Notes ----- Assuming that :math:`f\in C^{3}` (i.e., :math:`f` has at least 3 continuous derivatives) and let :math:`h_{*}` be a non-homogeneous stepsize, we minimize the "consistency error" :math:`\eta_{i}` between the true gradient and its estimate from a linear combination of the neighboring grid-points: .. math:: \eta_{i} = f_{i}^{\left(1\right)} - \left[ \alpha f\left(x_{i}\right) + \beta f\left(x_{i} + h_{d}\right) + \gamma f\left(x_{i}-h_{s}\right) \right] By substituting :math:`f(x_{i} + h_{d})` and :math:`f(x_{i} - h_{s})` with their Taylor series expansion, this translates into solving the following the linear system: .. math:: \left\{ \begin{array}{r} \alpha+\beta+\gamma=0 \\ \beta h_{d}-\gamma h_{s}=1 \\ \beta h_{d}^{2}+\gamma h_{s}^{2}=0 \end{array} \right. The resulting approximation of :math:`f_{i}^{(1)}` is the following: .. math:: \hat f_{i}^{(1)} = \frac{ h_{s}^{2}f\left(x_{i} + h_{d}\right) + \left(h_{d}^{2} - h_{s}^{2}\right)f\left(x_{i}\right) - h_{d}^{2}f\left(x_{i}-h_{s}\right)} { h_{s}h_{d}\left(h_{d} + h_{s}\right)} + \mathcal{O}\left(\frac{h_{d}h_{s}^{2} + h_{s}h_{d}^{2}}{h_{d} + h_{s}}\right) It is worth noting that if :math:`h_{s}=h_{d}` (i.e., data are evenly spaced) we find the standard second order approximation: .. math:: \hat f_{i}^{(1)}= \frac{f\left(x_{i+1}\right) - f\left(x_{i-1}\right)}{2h} + \mathcal{O}\left(h^{2}\right) With a similar procedure the forward/backward approximations used for boundaries can be derived. References ---------- .. [1] Quarteroni A., Sacco R., Saleri F. (2007) Numerical Mathematics (Texts in Applied Mathematics). New York: Springer. .. [2] Durran D. R. (1999) Numerical Methods for Wave Equations in Geophysical Fluid Dynamics. New York: Springer. .. [3] Fornberg B. (1988) Generation of Finite Difference Formulas on Arbitrarily Spaced Grids, Mathematics of Computation 51, no. 184 : 699-706. `PDF `_. Nrrsrqz&distances must be either scalars or 1dzGwhen 1d, distances must match the length of the corresponding dimensionzinvalid number of argumentsrz)'edge_order' greater than 2 not supportedÚdatetimeÚ timedeltazlShape of array too small to calculate a numerical gradient, at least (edge_order + 1) elements are required.rÔr¿r ç@gø¿gà¿éýÿÿÿrtgÀgø?)"r�r r¸rµÚrangerÂrÃr¶rõr r·rvÚ issubdtyperÓrr’Úfloat64r>rêrÈÚslicerÖÚ datetime64ÚnameÚreplaceÚviewÚ timedelta64Úinexactr÷Ú empty_likerÚintr[Ú_using_numpy2_behavior)rr¼rrÚNr¯Úlen_axesrbÚdxrÚ distancesÚdiffxÚoutvalsÚslice1Úslice2Úslice3Úslice4ÚotypeÚax_dxÚoutÚuniform_spacingÚdx1Údx2rÌÚbÚcrvÚdx_0Údx_ns rdr?r?ÌsÍ€õ^ Œ �aÑÔ€AØ Œ€Aà €|Ý•U˜1‘X”X‰ŒˆˆåÔ'¨¨aÑ0Ô0ˆå�4‰yŒy€HÝ ˆG‰ Œ €A؈A‚v€vàˆU�XÑ ˆ‰Ø ˆaŠˆ•B”G˜G AœJÑ'Ô'¨1Ò,Ð,à �xÑ ˆ‰Ø ˆhЉå �'‰]Œ]ˆÝ% b™MœMð ð ‰LˆAˆyÝœ  iÑ0Ô0ˆIØŒ~ Ò"Ð"ØØ” 1Ò$Ð$Ý Ð!IÑJÔJÐJÝ�9‰~Œ~ ¤¨¨a¬Ô!1Ò1Ð1Ý ð"MñNôNðNåŒ}˜Yœ_­b¬jÑ9Ô9ð 9ð&×,Ò,­R¬ZÑ8Ô8� Ý”G˜IÑ&Ô&ˆEð˜˜qœÒ!×&Ò&Ñ(Ô(ð !ؘaœ�؈Bˆq‰EˆEð% õ(Ð5Ñ6Ô6Ð6à�A‚~€~ÝÐDÑEÔEÐEð €Gõ�D‰kŒkˆ]˜1‰_€FÝ�D‰kŒkˆ]˜1‰_€FÝ�D‰kŒkˆ]˜1‰_€FÝ�D‰kŒkˆ]˜1‰_€Fà ŒG€EØ „z•R”]Ð"Ð"唘œ×+Ò+¨J¸ ÑDÔDÑEÔEˆà �FŠF�5‰MŒMˆˆØ Œ•r”~Ð %Ð %Ø Ý Œ�u�bœjÑ )Ô )ðØ õ Œ=˜¥¤ Ñ +Ô +ð %Ø—’�œÑ$Ô$ˆAÝ” ˆå˜4 ‘}”}ðZ#ñZ#‰ ˆˆeØ Œ7�4Œ=˜:¨™>Ò )Ð )ÝðCñDôDð DõŒm˜A UÐ+Ñ+Ô+ˆõœ' %™.œ.¨AÒ-ˆõ˜Q ‘|”|ˆˆt‰ ݘT 2‘”ˆˆt‰ ݘQ ‘|”|ˆˆt‰ ݘQ ‘~”~ˆˆt‰ à ð dØ"#¥E¨&¡M¤MÔ"2°Qµu¸V±}´}Ô5EÑ"EÈ"ÈuÉ*Ñ!UˆC•�f‘ ” Ñ Ð à˜˜"˜”+ˆCؘ˜˜”)ˆCØ�˜˜s S™yÑ)Ñ*ˆAØ�s‘˜s S™yÑ)ˆAØ�s˜c C™iÑ(Ñ)ˆAå”G˜A¥SÐ)Ñ)Ô)ˆE؈E�$‰KØ*/Ð /ˆAŒGÐ /�a”g ¤à!" Q¥u¨V¡}¤}Ô%5Ñ!5¸¸A½eÀF¹m¼mÔ>> u8_arr = np.array([1, 0], dtype=np.uint8) >>> np.diff(u8_arr) array([255], dtype=uint8) >>> u8_arr[1,...] - u8_arr[0,...] 255 If this is not desirable, then the array should be cast to a larger integer type first: >>> i16_arr = u8_arr.astype(np.int16) >>> np.diff(i16_arr) array([-1], dtype=int16) Examples -------- >>> x = np.array([1, 2, 4, 7, 0]) >>> np.diff(x) array([ 1, 2, 3, -7]) >>> np.diff(x, n=2) array([ 1, 1, -10]) >>> x = np.array([[1, 3, 6, 10], [0, 5, 6, 8]]) >>> np.diff(x) array([[2, 3, 4], [5, 1, 2]]) >>> np.diff(x, axis=0) array([[-1, 2, 0, -2]]) >>> x = np.arange('1066-10-13', '1066-10-16', dtype=np.datetime64) >>> np.diff(x) array([1, 1], dtype='timedelta64[D]') rz#order must be non-negative but got z4diff requires input that is at least one dimensionalrqNr¿)r·Úreprr r¸r/r�rÕrõrvrÛrµr[r¶r r)rÓrÙr r!r&) rÌrbr¼rHr[ÚndÚcombinedrvr9r:Úoprks rdr>r>,s(€ðj ˆA‚v€v؈؈1‚u€uÝØ 1µD¸±G´GÑ ;ñ=ô=ð =õ �1‰ Œ €AØ Œ€BØ ˆQ‚w€wÝÐOÑPÔPÐPÝ   bÑ )Ô )€Dà€HØ•b”kÐ!Ð!Ý”- Ñ(Ô(ˆØ Œ<˜1Ò Ð Ý˜œ‘M”MˆE؈E�$‰KÝ”o g­u°U©|¬|Ñ<Ô<ˆGØ�Š˜Ñ Ô Ð à ‡O‚O�AÑÔÐà •R”[Ð Ð Ý”˜vÑ&Ô&ˆØ Œ;˜!Ò Ð Ý˜œ‘M”MˆE؈E�$‰KÝ”_ V­U°5©\¬\Ñ:Ô:ˆFØ�Š˜ÑÔÐå ˆ8�}„}�qÒÐÝ ŒN˜8 TÑ *Ô *ˆå�D‰kŒkˆ]˜RÑ €FÝ�D‰kŒkˆ]˜RÑ €Fݘ˜D‘>”>€Fˆ4�Lݘ˜r‘?”?€Fˆ4�LÝ �6‰]Œ]€FÝ �6‰]Œ]€Fà”g¥¤Ò)Ð)�ˆ­x€BÝ �1‰XŒXð%ð%ˆØ ˆBˆq�Œy˜!˜Fœ)Ñ $Ô $ˆˆà €Hrfcó —|||fSr_rh)rìÚxpÚfpÚleftÚrightÚperiods rdÚ_interp_dispatcherrU±s€Ø ˆr�2ˆ;Ðrfcód—tj|¦«}tj|¦«rt}tj}nt }tj}|��P|dkrtd¦«‚t|¦«}d}d}tj|tj¬¦«}tj|tj¬¦«}tj||¬¦«}|j dks |j dkrtd¦«‚|j d|j dkrtd¦«‚||z}||z}tj |¦«}||}||}tj |dd…|z ||dd…|zf¦«}tj |dd…||dd…f¦«}||||||¦«S) a One-dimensional linear interpolation for monotonically increasing sample points. Returns the one-dimensional piecewise linear interpolant to a function with given discrete data points (`xp`, `fp`), evaluated at `x`. Parameters ---------- x : array_like The x-coordinates at which to evaluate the interpolated values. xp : 1-D sequence of floats The x-coordinates of the data points, must be increasing if argument `period` is not specified. Otherwise, `xp` is internally sorted after normalizing the periodic boundaries with ``xp = xp % period``. fp : 1-D sequence of float or complex The y-coordinates of the data points, same length as `xp`. left : optional float or complex corresponding to fp Value to return for `x < xp[0]`, default is `fp[0]`. right : optional float or complex corresponding to fp Value to return for `x > xp[-1]`, default is `fp[-1]`. period : None or float, optional A period for the x-coordinates. This parameter allows the proper interpolation of angular x-coordinates. Parameters `left` and `right` are ignored if `period` is specified. .. versionadded:: 1.10.0 Returns ------- y : float or complex (corresponding to fp) or ndarray The interpolated values, same shape as `x`. Raises ------ ValueError If `xp` and `fp` have different length If `xp` or `fp` are not 1-D sequences If `period == 0` See Also -------- scipy.interpolate Warnings -------- The x-coordinate sequence is expected to be increasing, but this is not explicitly enforced. However, if the sequence `xp` is non-increasing, interpolation results are meaningless. Note that, since NaN is unsortable, `xp` also cannot contain NaNs. A simple check for `xp` being strictly increasing is:: np.all(np.diff(xp) > 0) Examples -------- >>> xp = [1, 2, 3] >>> fp = [3, 2, 0] >>> np.interp(2.5, xp, fp) 1.0 >>> np.interp([0, 1, 1.5, 2.72, 3.14], xp, fp) array([3. , 3. , 2.5 , 0.56, 0. ]) >>> UNDEF = -99.0 >>> np.interp(3.14, xp, fp, right=UNDEF) -99.0 Plot an interpolant to the sine function: >>> x = np.linspace(0, 2*np.pi, 10) >>> y = np.sin(x) >>> xvals = np.linspace(0, 2*np.pi, 50) >>> yinterp = np.interp(xvals, x, y) >>> import matplotlib.pyplot as plt >>> plt.plot(x, y, 'o') [] >>> plt.plot(xvals, yinterp, '-x') [] >>> plt.show() Interpolation with periodic x-coordinates: >>> x = [-180, -170, -185, 185, -10, -5, 0, 365] >>> xp = [190, -190, 350, -350] >>> fp = [5, 10, 3, 4] >>> np.interp(x, xp, fp, period=360) array([7.5 , 5. , 8.75, 6.25, 3. , 3.25, 3.5 , 3.75]) Complex interpolation: >>> x = [1.5, 4.0] >>> xp = [2,3,5] >>> fp = [1.0j, 0, 2+3j] >>> np.interp(x, xp, fp) array([0.+1.j , 1.+1.5j]) Nrzperiod must be a non-zero valuerÔrqz!Data points must be 1-D sequencesz$fp and xp are not of the same lengthr¿) r�r Ú iscomplexobjÚcompiled_interp_complexÚ complex128Úcompiled_interpr(r·Úabsr¸rvÚargsortr ) rìrPrQrRrSrTÚ interp_funcÚ input_dtypeÚasort_xps rdr1r1µs˜€õR Œ�B‰Œ€Bå „�rÑÔð!Ý-ˆ Ý”mˆ ˆ å%ˆ Ý”jˆ à ÑØ �QŠ;ˆ;ÝÐ>Ñ?Ô?Ð ?Ý�V‘”ˆØˆØˆå ŒJ�q¥¤ Ð +Ñ +Ô +ˆÝ ŒZ˜¥"¤*Ð -Ñ -Ô -ˆÝ ŒZ˜ +Ð .Ñ .Ô .ˆà Œ7�aŠ<ˆ<˜2œ7 aš<˜<ÝÐ@ÑAÔAÐ AØ Œ8�AŒ;˜"œ( 1œ+Ò %Ð %ÝÐCÑDÔDÐ Dà �‰JˆØ �&‰[ˆÝ”:˜b‘>”>ˆØ �Œ\ˆØ �Œ\ˆÝ Œ^˜R   œW V™^¨R°°A°a°C´¸±Ð@Ñ AÔ AˆÝ Œ^˜R   œW b¨"¨Q¨q¨S¬'Ð2Ñ 3Ô 3ˆà ˆ;�q˜"˜b $¨Ñ .Ô .Ð.rfcó—|fSr_rh)ÚzÚdegs rdÚ_angle_dispatcherrcBr±rfcóЗt|¦«}t|jjtj¦«r|j}|j}nd}|}t||¦«}|r |dtz z}|S)aÉ Return the angle of the complex argument. Parameters ---------- z : array_like A complex number or sequence of complex numbers. deg : bool, optional Return angle in degrees if True, radians if False (default). Returns ------- angle : ndarray or scalar The counterclockwise angle from the positive real axis on the complex plane in the range ``(-pi, pi]``, with dtype as numpy.float64. .. versionchanged:: 1.16.0 This function works on subclasses of ndarray like `ma.array`. See Also -------- arctan2 absolute Notes ----- Although the angle of the complex number 0 is undefined, ``numpy.angle(0)`` returns the value 0. Examples -------- >>> np.angle([1.0, 1.0j, 1+1j]) # in radians array([ 0. , 1.57079633, 0.78539816]) # may vary >>> np.angle(1+1j, deg=True) # in degrees 45.0 ré´) r rØrÓrÖrÂÚcomplexfloatingÚimagÚrealrr)rarbÚzimagÚzrealrÌs rdr@r@Fsl€õN �1‰ Œ €AÝ�!”'”,¥Ô 3Ñ4Ô4ðØ”ˆØ”ˆˆàˆØˆå��uÑÔ€AØ ðØ ˆS•‰V‰ ˆØ €Hrf)rTcó—|fSr_rh)ÚpÚdiscontr¼rTs rdÚ_unwrap_dispatcherrn{r±rfcó²—t|¦«}|j}t||¬¦«}|€|dz }tdd¦«g|z}tdd¦«||<t |¦«}t j||¦«}tj|tj ¦«rt|d¦«\}} | dk} n|dz }d} | } t|| z |¦«| z} | r"tj | || | k|dkz¬¦«| |z } tj | dt|¦«|k¬¦«t|d|¬¦«}|||  |¦«z||<|S) a Unwrap by taking the complement of large deltas with respect to the period. This unwraps a signal `p` by changing elements which have an absolute difference from their predecessor of more than ``max(discont, period/2)`` to their `period`-complementary values. For the default case where `period` is :math:`2\pi` and `discont` is :math:`\pi`, this unwraps a radian phase `p` such that adjacent differences are never greater than :math:`\pi` by adding :math:`2k\pi` for some integer :math:`k`. Parameters ---------- p : array_like Input array. discont : float, optional Maximum discontinuity between values, default is ``period/2``. Values below ``period/2`` are treated as if they were ``period/2``. To have an effect different from the default, `discont` should be larger than ``period/2``. axis : int, optional Axis along which unwrap will operate, default is the last axis. period : float, optional Size of the range over which the input wraps. By default, it is ``2 pi``. .. versionadded:: 1.21.0 Returns ------- out : ndarray Output array. See Also -------- rad2deg, deg2rad Notes ----- If the discontinuity in `p` is smaller than ``period/2``, but larger than `discont`, no unwrapping is done because taking the complement would only make the discontinuity larger. Examples -------- >>> phase = np.linspace(0, np.pi, num=5) >>> phase[3:] += np.pi >>> phase array([ 0. , 0.78539816, 1.57079633, 5.49778714, 6.28318531]) # may vary >>> np.unwrap(phase) array([ 0. , 0.78539816, 1.57079633, -0.78539816, 0. ]) # may vary >>> np.unwrap([0, 1, 2, -1, 0], period=4) array([0, 1, 2, 3, 4]) >>> np.unwrap([ 1, 2, 3, 4, 5, 6, 1, 2, 3], period=6) array([1, 2, 3, 4, 5, 6, 7, 8, 9]) >>> np.unwrap([2, 3, 4, 5, 2, 3, 4, 5], period=4) array([2, 3, 4, 5, 6, 7, 8, 9]) >>> phase_deg = np.mod(np.linspace(0 ,720, 19), 360) - 180 >>> np.unwrap(phase_deg, period=360) array([-180., -140., -100., -60., -20., 20., 60., 100., 140., 180., 220., 260., 300., 340., 380., 420., 460., 500., 540.]) róNrrqrTr )r;rÓ)r r¸r>r)rµr�rÚrÂr'rÚdivmodrrr[r Úcumsum)rlrmr¼rTrLÚddr9rÓÚ interval_highÚremÚboundary_ambiguousÚ interval_lowÚddmodÚ ph_correctÚups rdrArAs}€õD �‰ Œ €AØ Œ€BÝ ˆa�dÐ Ñ Ô €B؀ؘ‘(ˆÝ�D˜$ÑÔÐ  Ñ #€Fݘ˜D‘>”>€Fˆ4�LÝ �6‰]Œ]€FÝ ŒN˜2˜vÑ &Ô &€EÝ „~�e�Sœ[Ñ)Ô)ð"Ý# F¨AÑ.Ô.ш �sØ  AšXÐÐà ™ ˆ Ø!ÐØ!�>€LÝ ��\Ñ! 6Ñ *Ô *¨\Ñ 9€EØð=õ Œ �5˜-Ø <Ò/°B¸²FÑ;ð =ñ =ô =ð =à˜‘€JÝ„Jˆz˜1¥C¨¡G¤G¨gÒ$5Ð6Ñ6Ô6Ð6Ý ˆq�t 5Ð )Ñ )Ô )€BØ�6”˜Z×.Ò.¨tÑ4Ô4Ñ4€B€v�JØ €Irfcó—|fSr_rh©rÌs rdÚ _sort_complexr|ßr±rfcóR—t|d¬¦«}| ¦«t|jjt j¦«s]|jjdvr| d¦«S|jjdkr| d¦«S| d¦«S|S)aî Sort a complex array using the real part first, then the imaginary part. Parameters ---------- a : array_like Input array Returns ------- out : complex ndarray Always returns a sorted complex array. Examples -------- >>> np.sort_complex([5, 3, 6, 2, 1]) array([1.+0.j, 2.+0.j, 3.+0.j, 5.+0.j, 6.+0.j]) >>> np.sort_complex([1 + 2j, 2 - 1j, 3 - 2j, 3 - 3j, 3 + 5j]) array([1.+2.j, 2.-1.j, 3.-3.j, 3.-2.j, 3.+5.j]) T©r;ÚbhBHÚFÚgÚGÚD) r ÚsortrØrÓrÖrÂrfrèr’©rÌrCs rdrBrBãs�€õ0 ˆa�dÐÑÔ€A؇F‚F�H„H€HÝ �a”g”l¥CÔ$7Ñ 8Ô 8ðØ Œ7Œ<˜6Ð !Ð !Ø—8’8˜C‘=”=Ð Ø ŒWŒ\˜SÒ Ð Ø—8’8˜C‘=”=Ð à—8’8˜C‘=”=Ð àˆrfcó—|fSr_rh)ÚfiltÚtrims rdÚ _trim_zerosr‰s €Ø ˆ7€NrfÚfbcóÊ—d}| ¦«}d|vr|D]}|dkrn|dz}Œt|¦«}d|vr|ddd…D]}|dkrn|dz }Œ|||…S)a/ Trim the leading and/or trailing zeros from a 1-D array or sequence. Parameters ---------- filt : 1-D array or sequence Input array. trim : str, optional A string with 'f' representing trim from front and 'b' to trim from back. Default is 'fb', trim zeros from both front and back of the array. Returns ------- trimmed : 1-D array or sequence The result of trimming the input. The input data type is preserved. Examples -------- >>> a = np.array((0, 0, 0, 1, 2, 3, 0, 2, 1, 0)) >>> np.trim_zeros(a) array([1, 2, 3, 0, 2, 1]) >>> np.trim_zeros(a, 'b') array([0, 0, 0, ..., 0, 2, 1]) The input data type is preserved, list/tuple in means list/tuple out. >>> np.trim_zeros([0, 1, 2, 0]) [1, 2] rr€r™rqÚBNr¿)Úupperr¶)r‡rˆÚfirstrÚlasts rdr:r: s�€ðF €EØ �:Š:‰<Œ<€DØ ˆd€{€{Øð "ð "ˆAØ�BŠwˆwØ�à ™ ��Ý ˆt‰9Œ9€DØ ˆd€{€{Ø�d�d˜�d”ð ð ˆAØ�BŠwˆwØ�à˜a‘x��Ø ��d� Ô Ðrfcó —||fSr_rh©Ú conditionÚarrs rdÚ_extract_dispatcherr”As €Ø �sÐ Ðrfcó†—tjt|¦«tt|¦«¦«d¦«S)a¨ Return the elements of an array that satisfy some condition. This is equivalent to ``np.compress(ravel(condition), ravel(arr))``. If `condition` is boolean ``np.extract`` is equivalent to ``arr[condition]``. Note that `place` does the exact opposite of `extract`. Parameters ---------- condition : array_like An array whose nonzero or True entries indicate the elements of `arr` to extract. arr : array_like Input array of the same size as `condition`. Returns ------- extract : ndarray Rank 1 array of values from `arr` where `condition` is True. See Also -------- take, put, copyto, compress, place Examples -------- >>> arr = np.arange(12).reshape((3, 4)) >>> arr array([[ 0, 1, 2, 3], [ 4, 5, 6, 7], [ 8, 9, 10, 11]]) >>> condition = np.mod(arr, 3)==0 >>> condition array([[ True, False, False, True], [False, False, True, False], [False, True, False, False]]) >>> np.extract(condition, arr) array([0, 3, 6, 9]) If `condition` is boolean: >>> arr[condition] array([0, 3, 6, 9]) r)rÂrr"r#r‘s rdrFrFEs2€õb Œ8•E˜#‘J”J¥­¨iÑ(8Ô(8Ñ 9Ô 9¸!Ô <Ñ =Ô =Ð=rfcó —|||fSr_rh©r“Úmaskrÿs rdÚ_place_dispatcherr™ys€Ø ��tÐ Ðrfcó$—t|||¦«S)a Change elements of an array based on conditional and input values. Similar to ``np.copyto(arr, vals, where=mask)``, the difference is that `place` uses the first N elements of `vals`, where N is the number of True values in `mask`, while `copyto` uses the elements where `mask` is True. Note that `extract` does the exact opposite of `place`. Parameters ---------- arr : ndarray Array to put data into. mask : array_like Boolean mask array. Must have the same size as `a`. vals : 1-D sequence Values to put into `a`. Only the first N elements are used, where N is the number of True values in `mask`. If `vals` is smaller than N, it will be repeated, and if elements of `a` are to be masked, this sequence must be non-empty. See Also -------- copyto, put, take, extract Examples -------- >>> arr = np.arange(6).reshape(2, 3) >>> np.place(arr, arr>2, [44, 55]) >>> arr array([[ 0, 1, 2], [44, 55, 44]]) )r,r—s rdrGrG}s€õJ �#�t˜TÑ "Ô "Ð"rfTcó°—|€ tj}|r| d|z¦«n| d|z¦«| ¦«dS)a2 Display a message on a device. Parameters ---------- mesg : str Message to display. device : object Device to write message. If None, defaults to ``sys.stdout`` which is very similar to ``print``. `device` needs to have ``write()`` and ``flush()`` methods. linefeed : bool, optional Option whether to print a line feed or not. Defaults to True. Raises ------ AttributeError If `device` does not have a ``write()`` or ``flush()`` method. Examples -------- Besides ``sys.stdout``, a file-like object can also be used as it has both required methods: >>> from io import StringIO >>> buf = StringIO() >>> np.disp(u'"Display" in a file', device=buf) >>> buf.getvalue() '"Display" in a file\n' Nz%s z%s)ÚsysÚstdoutÚwriteÚflush)ÚmesgÚdeviceÚlinefeeds rdrCrC¥sZ€ð@€~Ý”ˆØð"Ø� Š �V˜d‘]Ñ#Ô#Ð#Ð#à� Š �T˜D‘[Ñ!Ô!Ð!Ø ‡L‚L�N„N€NØ €Frfz\w+z(?:{0:}(?:,{0:})*)?z\({}\)z{0:}(?:,{0:})*z ^{0:}->{0:}$cóþ—tjdd|¦«}tjt|¦«s"t d |¦«¦«‚t d„| d¦«D¦«¦«S)as Parse string signatures for a generalized universal function. Arguments --------- signature : string Generalized universal function signature, e.g., ``(m,n),(n,p)->(m,p)`` for ``np.matmul``. Returns ------- Tuple of input and output core dimensions parsed from the signature, each of the form List[Tuple[str, ...]]. z\s+Úz not a valid gufunc signature: {}c3ó^K—|](}d„tjt|¦«D¦«V—Œ)dS)có\—g|])}ttjt|¦«¦«‘Œ*Srh)rµÚreÚfindallÚ_DIMENSION_NAME©rÚargs rdrz5_parse_gufunc_signature...ës<€ð>ð>ð>Øõ�œ ¥?°CÑ8Ô8Ñ9Ô9ð>ð>ð>rfN)r§r¨Ú _ARGUMENT)rÚarg_lists rdú z*_parse_gufunc_signature..ësYèè€ð8ð8àð>ð>ÝœZ­ °8Ñ<Ô<ð>ñ>ô>ð8ð8ð8ð8ð8ð8rfz->)r§ÚsubÚmatchÚ _SIGNATUREr·r¹rµÚsplit)Ú signatures rdÚ_parse_gufunc_signaturer´×sŒ€õ”�v˜r 9Ñ-Ô-€Iå Œ8•J  Ñ *Ô *ðBÝØ .× 5Ò 5°iÑ @Ô @ñBôBð Bå ð8ð8à!*§¢°Ñ!6Ô!6ð8ñ8ô8ñ 8ô 8ð8rfc ó(—|sdSt|¦«}|j|krtd|j|fz¦«‚|j| d…}t ||¦«D]9\}}||vr+|||krtd|›d|›d||›�¦«‚Œ4|||<Œ:dS)aO Incrementally check and update core dimension sizes for a single argument. Arguments --------- dim_sizes : Dict[str, int] Sizes of existing core dimensions. Will be updated in-place. arg : ndarray Argument to examine. core_dims : Tuple[str, ...] Core dimensions for this argument. NzR%d-dimensional argument does not have enough dimensions for all core dimensions %rz%inconsistent size for core dimension z: z vs )r¶r¸r·rvr÷)Ú dim_sizesr«Ú core_dimsÚ num_core_dimsÚ core_shapeÚdimr×s rdÚ_update_dim_sizesr»ðsä€ð ðØˆå˜ ‘N”N€MØ „x�-ÒÐÝð 4àŒx˜Ð#ñ $ñ%ô%ð %𠔘M˜>˜?˜?Ô+€Jݘ JÑ/Ô/ð"ð"‰ ˆˆTØ �)Ð Ð Ø�y ”~Ò%Ð%Ý �jà�s�s˜D˜D˜D )¨C¤. .ð2ñ3ô3ð3ð&ð "ˆI�c‰NˆNð"ð"rfcóL—g}i}t||¦«D]t\}}t|||¦«|jt|¦«z }tjj d|jd|…¦«}|  |¦«Œut jjj |Ž}||fS)aë Parse broadcast and core dimensions for vectorize with a signature. Arguments --------- args : Tuple[ndarray, ...] Tuple of input arguments to examine. input_core_dims : List[Tuple[str, ...]] List of core dimensions corresponding to each input. Returns ------- broadcast_shape : Tuple[int, ...] Common shape to broadcast all non-core dimensions to. dim_sizes : Dict[str, int] Common sizes for named core dimensions. rN) r÷r»r¸r¶r�ÚlibÚ stride_tricksÚ as_stridedrvr[Ú_broadcast_shape) rïÚinput_core_dimsÚbroadcast_argsr¶r«r·r¸Ú dummy_arrayÚbroadcast_shapes rdÚ_parse_input_dimensionsrÅs¨€ð$€NØ€Iݘd OÑ4Ô4ð+ð+‰ˆˆYݘ) S¨)Ñ4Ô4Ð4ØŒx�#˜i™.œ.Ñ(ˆÝ”fÔ*×5Ò5°a¸¼À5ÀDÀ5Ô9IÑJÔJˆ Ø×Ò˜kÑ*Ô*Ð*Ð*Ý”fÔ*Ô;¸^ÐL€OØ ˜IÐ %Ð%rfcó$‡‡—ˆˆfd„|D¦«S)z=Helper for calculating broadcast shapes with core dimensions.cóL•—g|] }‰tˆfd„|D¦«¦«z‘Œ!S)c3ó(•K—|] }‰|V—Œ dSr_rh)rrºr¶s €rdr®z/_calculate_shapes...1s'øèè€Ð#HÐ#H°s I¨c¤NÐ#HÐ#HÐ#HÐ#HÐ#HÐ#Hrf)rµ)rr·rÄr¶s €€rdrz%_calculate_shapes..1sKø€ð 0ð 0ð 0Øð �eÐ#HÐ#HÐ#HÐ#H¸iÐ#HÑ#HÔ#HÑHÔHÑ Hð 0ð 0ð 0rfrh)rÄr¶Úlist_of_core_dimss`` rdÚ_calculate_shapesrÊ/s4øø€ð 0ð 0ð 0ð 0ð 0Ø.ð 0ñ 0ô 0ð0rfcóö—t|||¦«}|€dgt|¦«z}|€(td„t||¦«D¦«¦«}n(td„t|||¦«D¦«¦«}|S)z/Helper for creating output arrays in vectorize.Nc3óHK—|]\}}tj||¬¦«V—ŒdS©)rvrÓN)r�r )rrvrÓs rdr®z!_create_arrays..<sQèè€ð@ð@Ù'˜5 %õ”x e°5Ð9Ñ9Ô9ð@ð@ð@ð@ð@ð@rfc3óLK—|]\}}}tj|||¬¦«V—Œ dSrÍ)r�r0)rrrvrÓs rdr®z!_create_arrays..?sMèè€ð8ð8Ù/˜6 5¨%õ”} V°5ÀÐFÑFÔFð8ð8ð8ð8ð8ð8rf)rÊr¶rµr÷)rÄr¶rÉÚdtypesÚresultsÚshapesÚarrayss rdÚ_create_arraysrÓ5s°€õ˜° Ð;LÑ MÔ M€FØ €~Ø��#˜f™+œ+Ñ%ˆØ€Ýð@ð@Ý+.¨v°vÑ+>Ô+>ð@ñ@ô@ñ@ô@ˆˆõð8ð8å˜g v¨vÑ6Ô6ð8ñ8ô8ñ8ô8ˆð €MrfcóT—eZdZdZejdddddfd„Zd„Zd„Zd„Z d„Z d „Z d „Z dS) rHaá vectorize(pyfunc=np._NoValue, otypes=None, doc=None, excluded=None, cache=False, signature=None) Returns an object that acts like pyfunc, but takes arrays as input. Define a vectorized function which takes a nested sequence of objects or numpy arrays as inputs and returns a single numpy array or a tuple of numpy arrays. The vectorized function evaluates `pyfunc` over successive tuples of the input arrays like the python map function, except it uses the broadcasting rules of numpy. The data type of the output of `vectorized` is determined by calling the function with the first element of the input. This can be avoided by specifying the `otypes` argument. Parameters ---------- pyfunc : callable, optional A python function or method. Can be omitted to produce a decorator with keyword arguments. otypes : str or list of dtypes, optional The output data type. It must be specified as either a string of typecode characters or a list of data type specifiers. There should be one data type specifier for each output. doc : str, optional The docstring for the function. If None, the docstring will be the ``pyfunc.__doc__``. excluded : set, optional Set of strings or integers representing the positional or keyword arguments for which the function will not be vectorized. These will be passed directly to `pyfunc` unmodified. .. versionadded:: 1.7.0 cache : bool, optional If `True`, then cache the first function call that determines the number of outputs if `otypes` is not provided. .. versionadded:: 1.7.0 signature : string, optional Generalized universal function signature, e.g., ``(m,n),(n)->(m)`` for vectorized matrix-vector multiplication. If provided, ``pyfunc`` will be called with (and expected to return) arrays with shapes given by the size of corresponding core dimensions. By default, ``pyfunc`` is assumed to take scalars as input and output. .. versionadded:: 1.12.0 Returns ------- out : callable A vectorized function if ``pyfunc`` was provided, a decorator otherwise. See Also -------- frompyfunc : Takes an arbitrary Python function and returns a ufunc Notes ----- The `vectorize` function is provided primarily for convenience, not for performance. The implementation is essentially a for loop. If `otypes` is not specified, then a call to the function with the first argument will be used to determine the number of outputs. The results of this call will be cached if `cache` is `True` to prevent calling the function twice. However, to implement the cache, the original function must be wrapped which will slow down subsequent calls, so only do this if your function is expensive. The new keyword argument interface and `excluded` argument support further degrades performance. References ---------- .. [1] :doc:`/reference/c-api/generalized-ufuncs` Examples -------- >>> def myfunc(a, b): ... "Return a-b if a>b, otherwise return a+b" ... if a > b: ... return a - b ... else: ... return a + b >>> vfunc = np.vectorize(myfunc) >>> vfunc([1, 2, 3, 4], 2) array([3, 4, 1, 2]) The docstring is taken from the input function to `vectorize` unless it is specified: >>> vfunc.__doc__ 'Return a-b if a>b, otherwise return a+b' >>> vfunc = np.vectorize(myfunc, doc='Vectorized `myfunc`') >>> vfunc.__doc__ 'Vectorized `myfunc`' The output type is determined by evaluating the first element of the input, unless it is specified: >>> out = vfunc([1, 2, 3, 4], 2) >>> type(out[0]) >>> vfunc = np.vectorize(myfunc, otypes=[float]) >>> out = vfunc([1, 2, 3, 4], 2) >>> type(out[0]) The `excluded` argument can be used to prevent vectorizing over certain arguments. This can be useful for array-like arguments of a fixed length such as the coefficients for a polynomial as in `polyval`: >>> def mypolyval(p, x): ... _p = list(p) ... res = _p.pop(0) ... while _p: ... res = res*x + _p.pop(0) ... return res >>> vpolyval = np.vectorize(mypolyval, excluded=['p']) >>> vpolyval(p=[1, 2, 3], x=[0, 1]) array([3, 6]) Positional arguments may also be excluded by specifying their position: >>> vpolyval.excluded.add(0) >>> vpolyval([1, 2, 3], x=[0, 1]) array([3, 6]) The `signature` argument allows for vectorizing functions that act on non-scalar arrays of fixed length. For example, you can use it for a vectorized calculation of Pearson correlation coefficient and its p-value: >>> import scipy.stats >>> pearsonr = np.vectorize(scipy.stats.pearsonr, ... signature='(n),(n)->(),()') >>> pearsonr([[0, 1, 2, 3]], [[1, 2, 3, 4], [4, 3, 2, 1]]) (array([ 1., -1.]), array([ 0., 0.])) Or for a vectorized convolution: >>> convolve = np.vectorize(np.convolve, signature='(n),(m)->(k)') >>> convolve(np.eye(4), [1, 2, 1]) array([[1., 2., 1., 0., 0., 0.], [0., 1., 2., 1., 0., 0.], [0., 0., 1., 2., 1., 0.], [0., 0., 0., 1., 2., 1.]]) Decorator syntax is supported. The decorator can be called as a function to provide keyword arguments. >>>@np.vectorize ...def identity(x): ... return x ... >>>identity([0, 1, 2]) array([0, 1, 2]) >>>@np.vectorize(otypes=[float]) ...def as_float(x): ... return x ... >>>as_float([0, 1, 2]) array([0., 1., 2.]) NFcóô—|tjkr%t|¦«sd}d}t||z¦«‚||_||_||_|tjkrt|d¦«r |j|_i|_ d|_ ||_ |€t|d¦«r |j |_ n||_ t|t¦«r'|D]#} | tdvrtd| ›�¦«‚Œ$n@t!|¦«r d d„|D¦«¦«}n|�td ¦«‚||_|€t'¦«}t'|¦«|_|�t+|¦«|_dSd|_dS) NzWhen used as a decorator, zonly accepts keyword arguments.Ú__name__Ú__doc__ÚAllzInvalid otype specified: r¤có@—g|]}tj|¦«j‘ŒSrh)rÂrÓrè©rrìs rdrz&vectorize.__init__.. s#€Ð@Ð@Ð@°A�cœi¨™lœlÔ/Ð@Ð@Ð@rfzInvalid otype specification)r�rÕÚcallablerÈÚpyfuncÚcacher³rÀrÖÚ_ufuncÚ_docr×rôÚstrr(r·r<ÚjoinÚotypesÚsetÚexcludedr´Ú_in_and_out_core_dims) ÚselfrÜrâÚdocrärÝr³Úpart1Úpart2rès rdÚ__init__zvectorize.__init__ís›€ð •b”kÒ !Ð !­H°VÑ,<Ô,<Ð !ð1ˆEØ5ˆEݘE E™MÑ*Ô*Ð *àˆŒ ؈Œ Ø"ˆŒØ •R”[Ò Ð ¥W¨V°ZÑ%@Ô%@Ð Ø"œOˆDŒMàˆŒ ؈Œ ؈Œ Ø ˆ;�7 6¨9Ñ5Ô5ˆ;Ø!œ>ˆDŒLˆLàˆDŒIå �f�cÑ "Ô "ð <Øð Nð N�Ø�y¨Ô/Ð/Ð/Ý$˜*ÀdÀdÐ%LÑMÔMÐMð0ð Nõ�fÑ Ô ð <Ø—W’WÐ@Ð@¸Ð@Ñ@Ô@ÑAÔAˆFˆFØ Ð ÝÐ:Ñ;Ô;Ð ;؈Œ ð Ð Ý‘u”uˆHݘH™ œ ˆŒ à Ð Ý)@ÀÑ)KÔ)KˆDÔ &Ð &Ð &à)-ˆDÔ &Ð &Ð &rfcón—|j|_||_|j€|j|_dS|j|_dSr_)rÖrÜrßr×)rærÜrïÚkwargss rdÚ _init_stage_2zvectorize._init_stage_2 s4€ØœˆŒ ؈Œ Ø Œ9Ð Ø!œ>ˆDŒLˆLˆLàœ9ˆDŒLˆLˆLrfcóf‡‡‡‡‡‡‡ —‰jЉs ‰s ‰j}‰}nt‰¦«}ˆfd„‰D¦«Šˆfd„t|¦«D¦«Št ‰¦«Š ˆˆˆˆˆ fd„}ˆfd„‰D¦«}| ˆfd„‰D¦«¦«‰ ||¬¦«S)z‡ Return arrays with the results of `pyfunc` broadcast (vectorized) over `args` and `kwargs` not in `excluded`. có•—g|]}|‰v¯|‘Œ Srhrh)rÚ_nräs €rdrz-vectorize._call_as_normal..0 s#ø€Ð?Ð?Ð?˜B¨B°hÐ,>Ð,>�RÐ,>Ð,>Ð,>rfcó•—g|]}|‰v¯|‘Œ Srhrh)rÚ_iräs €rdrz-vectorize._call_as_normal..1 s#ø€ÐDÐDÐD˜2°¸8Ð1CÐ1C�BÐ1CÐ1CÐ1Crfc óΕ—t‰¦«D]\}}||‰|<Œ‰ t‰|t‰¦«d…¦«¦«‰j‰i‰¤ŽSr_)r Úupdater÷r¶rÜ)ÚvargsrðròÚindsrìÚnamesræÚthe_argss €€€€€rdrþz'vectorize._call_as_normal..func4 smø€Ý'¨™oœoð-ð-‘F�B˜Ø#(¨¤9�H˜R‘L�LØ— ’ �c %¨­s°4©y¬y¨z¨zÔ):Ñ;Ô;Ñ<Ô<Ð<Ø"�t”{ HÐ7°Ð7Ð7Ð7rfcó •—g|] }‰|‘Œ Srhrh)rròrïs €rdrz-vectorize._call_as_normal..: sø€Ð-Ð-Ð- "�T˜"”XÐ-Ð-Ð-rfcó •—g|] }‰|‘Œ Srhrh)rrðrìs €rdrz-vectorize._call_as_normal..; sø€Ð5Ð5Ð5¨˜& œ*Ð5Ð5Ð5rf©rþrï)rärÜr¶r&rõÚextendÚ_vectorize_call) rærïrìrþrõÚnargsrärör÷røs ``` @@@@rdÚ_call_as_normalzvectorize._call_as_normal! søøøøøøø€ð ”=ˆØð 7˜hð 7Ø”;ˆD؈EˆEõ ˜‘I”IˆEà?Ð?Ð?Ð? &Ð?Ñ?Ô?ˆEØDÐDÐDÐD¥ u¡¤ÐDÑDÔDˆDݘD‘z”zˆHð 8ð 8ð 8ð 8ð 8ð 8ð 8ð 8ð 8ð .Ð-Ð-Ð-¨Ð-Ñ-Ô-ˆEØ �LŠLÐ5Ð5Ð5Ð5¨uÐ5Ñ5Ô5Ñ 6Ô 6Ð 6à×#Ò#¨°EÐ#Ñ:Ô:Ð:rfcó`—|jtjur|j|i|¤Ž|S|j|i|¤ŽSr_)rÜr�rÕrírÿ)rærïrìs rdÚ__call__zvectorize.__call__? sF€Ø Œ;�"œ+Ð %Ð %Ø ˆDÔ  Ð /¨Ð /Ð /Ð /؈Kà#ˆtÔ# TÐ4¨VÐ4Ð4Ð4rfcóЇ‡ ‡ —|std¦«‚|j�u|j}t|¦«}t|j¦«}‰|jus ||jvrt ‰||¦«}nd}‰|jur|j ||¦«}nÓd„|D¦«}tjd„|D¦«¦«rtd¦«‚d„|D¦«}‰|ŽŠ |j r ‰ gŠ ˆ ˆfd„}n‰}t‰ t¦«rt‰ ¦«}nd}‰ fŠ d   ˆ fd „t|¦«D¦«¦«}t |t|¦«|¦«}||fS) zReturn (ufunc, otypes).zargs can not be emptyNcó,—g|]}t|¦«‘ŒSrh)r rªs rdrz3vectorize._get_ufunc_and_otypes..d s€Ð1Ð1Ð1 S•G˜C‘L”LÐ1Ð1Ð1rfc3ó,K—|]}|jdkV—ŒdS©rN)r×rªs rdr®z2vectorize._get_ufunc_and_otypes..e s(èè€Ð:Ð:¨c˜CœH¨šMÐ:Ð:Ð:Ð:Ð:Ð:rfú?cannot call `vectorize` on size 0 inputs unless `otypes` is setcó(—g|]}|jd‘ŒS©r)Úflatrªs rdrz3vectorize._get_ufunc_and_otypes..i s€Ð2Ð2Ð2 c�c”h˜q”kÐ2Ð2Ð2rfcó:•—‰r‰ ¦«S‰|ŽSr_)Úpop)rõÚ_cacherþs €€rdÚ_funcz.vectorize._get_ufunc_and_otypes.._funcs s%ø€Øð,Ø%Ÿzšz™|œ|Ð+à#˜t U˜|Ð+rfrqr¤cóN•—g|]!}t‰|¦«jj‘Œ"Srh)r rÓrè)rÚ_kÚoutputss €rdrz3vectorize._get_ufunc_and_otypes..� s;ø€ð5ð5ð5Ø"$õ& g¨b¤kÑ2Ô2Ô8Ô=ð5ð5ð5rf)r·râr¶rÜrÞrÚ setdefaultÚbuiltinsr&rÝrôrµrár&) rærþrïrâÚninÚnoutÚufuncÚinputsr r rs ` @@rdÚ_get_ufunc_and_otypeszvectorize._get_ufunc_and_otypesF sÖøøø€ðð 6ÝÐ4Ñ5Ô5Ð 5à Œ;Ð "Ø”[ˆFõ�d‘)”)ˆCÝ�t”{Ñ#Ô#ˆDؘ4œ;Ð&Ð&¨#°T´[Ð*@Ð*@Ý" 4¨¨dÑ3Ô3��à�Ø�t”{Ð"Ð"Øœ ×.Ò.¨s°EÑ:Ô:�øð2Ð1¨DÐ1Ñ1Ô1ˆDÝŒ|Ð:Ð:°TÐ:Ñ:Ô:Ñ:Ô:ð ;Ý ð":ñ;ô;ð;ð3Ð2¨TÐ2Ñ2Ô2ˆFØ�d˜F�mˆGð Œzð Ø!˜�ð,ð,ð,ð,ð,ð,ð,ð �å˜'¥5Ñ)Ô)ð %ݘ7‘|”|��à�Ø"˜*�à—W’Wð5ð5ð5ð5Ý(-¨d© ¬ ð5ñ5ô5ñ6ô6ˆFõ ˜u¥c¨$¡i¤i°Ñ6Ô6ˆEà�fˆ}ÐrfcóF—|j�| ||¦«}n‚|s |¦«}nu| ||¬¦«\}}d„|D¦«}||Ž}|jdkrt ||d¬¦«}n't d„t ||¦«D¦«¦«}|S)z1Vectorized call to `func` over positional `args`.Nrûcó:—g|]}t|t¬¦«‘ŒS©rÔ)r Úobject)rrÌs rdrz-vectorize._vectorize_call..• s%€Ð@Ð@Ð@°a•j ­&Ð1Ñ1Ô1Ð@Ð@Ð@rfrqrrÔcó6—g|]\}}t||¬¦«‘ŒSr©r )rrìÚts rdrz-vectorize._vectorize_call..œ s9€ð?ð?ð?Ù!%  Aõ(¨°Ð3Ñ3Ô3ð?ð?ð?rf)r³Ú_vectorize_call_with_signaturerrr rµr÷)rærþrïÚresrrârrs rdrýzvectorize._vectorize_call‹ sÓ€à Œ>Ð %Ø×5Ò5°d¸DÑAÔAˆCˆCØð @Ø�$‘&”&ˆCˆCà ×6Ò6¸DÀtÐ6ÑLÔL‰MˆE�6ðAÐ@¸4Ð@Ñ@Ô@ˆFà�e˜V�nˆGàŒz˜QŠˆÝ  °°q´ Ð:Ñ:Ô:��åð?ð?Ý),¨W°fÑ)=Ô)=ð?ñ?ô?ñ@ô@�àˆ rfcó䇇—|j\}}t|¦«t|¦«kr/tdt|¦«›dt|¦«›�¦«‚td„|D¦«¦«}t ||¦«\}Št |‰|¦«}d„t ||¦«D¦«}d}|j}t|¦«} tj |ŽD]´Š|ˆfd„|D¦«Ž} t| t¦«rt| ¦«nd} | | krtd| ›d| ›�¦«‚| dkr| f} |€:t | |¦«D]\} } t‰| | ¦«Œt|‰||| ¦«}t || ¦«D] \}} | |‰<Œ Œµ|€R|€td ¦«‚tjˆfd „|D¦«¦«rtd ¦«‚t|‰||¦«}| dkr|d n|S) z;Vectorized call over positional arguments with a signature.z/wrong number of positional arguments: expected z, got c3ó4K—|]}t|¦«V—ŒdSr_rrªs rdr®z;vectorize._vectorize_call_with_signature..¨ s(èè€Ð5Ð5¨•Z ‘_”_Ð5Ð5Ð5Ð5Ð5Ð5rfcóB—g|]\}}tj||d¬¦«‘ŒS)T)r)r�rÛ)rr«rvs rdrz.® s=€ð;ð;ð;Ù�C˜õ”  U°$Ð7Ñ7Ô7ð;ð;ð;rfNc3ó(•K—|] }|‰V—Œ dSr_rh)rr«r›s €rdr®z;vectorize._vectorize_call_with_signature..¶ s'øèè€Ð8Ð8¨C˜S œZÐ8Ð8Ð8Ð8Ð8Ð8rfrqz.wrong number of outputs from pyfunc: expected rc3ó*•K—|] }|D]}|‰vV—Œ ŒdSr_rh)rÚdimsrºr¶s €rdr®z;vectorize._vectorize_call_with_signature..Ñ sQøèè€ð-ð-Ø $Ø'+ð-ð-à #ð  yÐ0ð-ð-ð-ð-ð-ð-ð-rfzYcannot call `vectorize` with a signature including new output dimensions on size 0 inputsr)rår¶rÈrµrÅrÊr÷râr�Úndindexrôr·r»rÓrr&)rærþrïrÁÚoutput_core_dimsrÄÚ input_shapesrrârrÐÚ n_resultsrr·Úoutputr¶r›s @@rdrz(vectorize._vectorize_call_with_signature  s¸øø€à,0Ô,FÑ)ˆÐ)å ˆt‰9Œ9�˜OÑ,Ô,Ò ,Ð ,Ý�)å" ?Ñ3Ô3Ð3Ð3µS¸±Y´Y°Yð@ñAôAð AõÐ5Ð5°Ð5Ñ5Ô5Ñ5Ô5ˆå%<Ø �/ñ&#ô&#Ñ"ˆ˜å(¨¸)Ø)8ñ:ô:ˆ ð;ð;Ý"% d¨LÑ"9Ô"9ð;ñ;ô;ˆðˆØ”ˆÝÐ#Ñ$Ô$ˆå”Z Ð1ð 'ð 'ˆEØ�dÐ8Ð8Ð8Ð8°4Ð8Ñ8Ô8Ð9ˆGå(2°7½EÑ(BÔ(BÐI�˜G™ œ ˜ ȈIà�yÒ Ð Ý �jà�t�t˜Y˜Yð(ñ)ô)ð)ð�qŠyˆyØ"˜*�àˆÝ),¨WÐ6FÑ)GÔ)GðDðDÑ%�F˜IÝ% i°¸ÑCÔCÐCÐCå(¨¸)Ø)9¸6À7ñLôL�õ#& g¨wÑ"7Ô"7ð 'ð '‘�˜Ø &��u‘ � ð 'ð ˆ?àˆ~Ý ð":ñ;ô;ð;åŒ|ð-ð-ð-ð-Ø(8ð-ñ-ô-ñ-ô-ð +õ!ð"*ñ+ô+ð+õ% _°iØ%5°vñ?ô?ˆGð" QšY˜Yˆw�qŒzˆz¨GÐ3rf) rÖÚ __module__Ú __qualname__r×r�rÕrêrírÿrrrýrrhrfrdrHrHEs¦€€€€€ðeðeðL!œk°$¸DØ e°tð*.ð*.ð*.ð*.ðX%ð%ð%ð;ð;ð;ð<5ð5ð5ðCðCðCðJððð*:4ð:4ð:4ð:4ð:4rfrHrÔcó—||||fSr_rh)r­rÉÚrowvarÚbiasÚddofÚfweightsÚaweightsrÓs rdÚ_cov_dispatcherr4Ý s€à ˆq�(˜HÐ %Ð%rfcó‚—|�"|t|¦«krtd¦«‚tj|¦«}|jdkrtd¦«‚|�.tj|¦«}|jdkrtd¦«‚|€B|€ tj|tj¦«}n tj||tj¦«}t|d|¬¦«}|s|jddkr|j }|jddkr(tjg¦«  dd¦«S|�Et|d d|¬ ¦«}|s|jddkr|j }tj ||fd¬ ¦«}|€ |dkrd}nd}d} |�½tj|t¬ ¦«}tj |tj|¦«k¦«std ¦«‚|jdkrt!d¦«‚|jd|jdkrt!d¦«‚t#|dk¦«rtd¦«‚|} |�Œtj|t¬ ¦«}|jdkrt!d¦«‚|jd|jdkrt!d¦«‚t#|dk¦«rtd¦«‚| €|} n| |z} t%|d| d¬¦«\} } | d} | €|jd|z } n,|dkr| } n#|€| |z } n| |t'| |z¦«z| z z } | dkrt)jdt,d¬¦«d} || dd…dfz}| €|j } n || zj } t/||  ¦«¦«}|tjd| ¦«z}| ¦«S)a' Estimate a covariance matrix, given data and weights. Covariance indicates the level to which two variables vary together. If we examine N-dimensional samples, :math:`X = [x_1, x_2, ... x_N]^T`, then the covariance matrix element :math:`C_{ij}` is the covariance of :math:`x_i` and :math:`x_j`. The element :math:`C_{ii}` is the variance of :math:`x_i`. See the notes for an outline of the algorithm. Parameters ---------- m : array_like A 1-D or 2-D array containing multiple variables and observations. Each row of `m` represents a variable, and each column a single observation of all those variables. Also see `rowvar` below. y : array_like, optional An additional set of variables and observations. `y` has the same form as that of `m`. rowvar : bool, optional If `rowvar` is True (default), then each row represents a variable, with observations in the columns. Otherwise, the relationship is transposed: each column represents a variable, while the rows contain observations. bias : bool, optional Default normalization (False) is by ``(N - 1)``, where ``N`` is the number of observations given (unbiased estimate). If `bias` is True, then normalization is by ``N``. These values can be overridden by using the keyword ``ddof`` in numpy versions >= 1.5. ddof : int, optional If not ``None`` the default value implied by `bias` is overridden. Note that ``ddof=1`` will return the unbiased estimate, even if both `fweights` and `aweights` are specified, and ``ddof=0`` will return the simple average. See the notes for the details. The default value is ``None``. .. versionadded:: 1.5 fweights : array_like, int, optional 1-D array of integer frequency weights; the number of times each observation vector should be repeated. .. versionadded:: 1.10 aweights : array_like, optional 1-D array of observation vector weights. These relative weights are typically large for observations considered "important" and smaller for observations considered less "important". If ``ddof=0`` the array of weights can be used to assign probabilities to observation vectors. .. versionadded:: 1.10 dtype : data-type, optional Data-type of the result. By default, the return data-type will have at least `numpy.float64` precision. .. versionadded:: 1.20 Returns ------- out : ndarray The covariance matrix of the variables. See Also -------- corrcoef : Normalized covariance matrix Notes ----- Assume that the observations are in the columns of the observation array `m` and let ``f = fweights`` and ``a = aweights`` for brevity. The steps to compute the weighted covariance are as follows:: >>> m = np.arange(10, dtype=np.float64) >>> f = np.arange(10) * 2 >>> a = np.arange(10) ** 2. >>> ddof = 1 >>> w = f * a >>> v1 = np.sum(w) >>> v2 = np.sum(w * a) >>> m -= np.sum(m * w, axis=None, keepdims=True) / v1 >>> cov = np.dot(m * w, m.T) * v1 / (v1**2 - ddof * v2) Note that when ``a == 1``, the normalization factor ``v1 / (v1**2 - ddof * v2)`` goes over to ``1 / (np.sum(f) - ddof)`` as it should. Examples -------- Consider two variables, :math:`x_0` and :math:`x_1`, which correlate perfectly, but in opposite directions: >>> x = np.array([[0, 2], [1, 1], [2, 0]]).T >>> x array([[0, 1, 2], [2, 1, 0]]) Note how :math:`x_0` increases while :math:`x_1` decreases. The covariance matrix shows this clearly: >>> np.cov(x) array([[ 1., -1.], [-1., 1.]]) Note that element :math:`C_{0,1}`, which shows the correlation between :math:`x_0` and :math:`x_1`, is negative. Further, note how `x` and `y` are combined: >>> x = [-2.1, -1, 4.3] >>> y = [3, 1.1, 0.12] >>> X = np.stack((x, y), axis=0) >>> np.cov(X) array([[11.71 , -4.286 ], # may vary [-4.286 , 2.144133]]) >>> np.cov(x, y) array([[11.71 , -4.286 ], # may vary [-4.286 , 2.144133]]) >>> np.cov(x) array(11.71) Nzddof must be integerrzm has more than 2 dimensionszy has more than 2 dimensions)ÚndminrÓrrqF©r;r6rÓrórÔzfweights must be integerz'cannot handle multidimensional fweightsz,incompatible numbers of samples and fweightszfweights cannot be negativez'cannot handle multidimensional aweightsz,incompatible numbers of samples and aweightszaweights cannot be negativeT)r¼rÍrÎz!Degrees of freedom <= 0 for slice©Ú stacklevelr™)r1r·r�r r¸rÚr(r rvÚTÚreshaper Úfloatrêr�rÈÚ RuntimeErrorr&rJr'ÚwarningsÚwarnÚRuntimeWarningrÚconjÚ true_divideÚsqueeze)r­rÉr/r0r1r2r3rÓÚXÚwràÚw_sumÚfactÚX_TrDs rdrLrLâ s€ðx ИD¥C¨¡I¤IÒ-Ð-ÝØ "ñ$ô$ð $õ Œ �1‰ Œ €AØ„v�‚z€zÝÐ7Ñ8Ô8Ð8à€}Ý ŒJ�q‰MŒMˆØ Œ6�AŠ:ˆ:ÝÐ;Ñ<Ô<Ð <à €}Ø ˆ9Ý”N 1¥b¤jÑ1Ô1ˆEˆEå”N 1 a­¬Ñ4Ô4ˆEå ˆa�q Ð&Ñ&Ô&€AØ ð�a”g˜a”j A’o�oØ ŒCˆØ„wˆq„z�Q‚€ÝŒx˜‰|Œ|×#Ò# A qÑ)Ô)Ð)Ø€}Ý �!˜% q°Ð 6Ñ 6Ô 6ˆØð ˜!œ' !œ*¨š/˜/Ø”ˆAÝ ŒN˜A˜q˜6¨Ð *Ñ *Ô *ˆà €|Ø �1Š9ˆ9؈DˆDàˆDð €AØÐÝ”:˜h­eÐ4Ñ4Ô4ˆÝŒv�h¥"¤)¨HÑ"5Ô"5Ò5Ñ6Ô6ð ,ÝØ*ñ,ô,ð ,à Œ=˜1Ò Ð ÝØ9ñ;ô;ð ;à Œ>˜!Ô  ¤¨¤ Ò *Ð *ÝØ>ñ@ô@ð @å ˆx˜!Š|Ñ Ô ð /ÝØ-ñ/ô/ð /à ˆØÐÝ”:˜h­eÐ4Ñ4Ô4ˆØ Œ=˜1Ò Ð ÝØ9ñ;ô;ð ;à Œ>˜!Ô  ¤¨¤ Ò *Ð *ÝØ>ñ@ô@ð @å ˆx˜!Š|Ñ Ô ð /ÝØ-ñ/ô/ð /à ˆ9؈AˆAà �‰MˆA嘠¨A¸Ð=Ñ=Ô=�J€CˆØ �!ŒH€Eð €yØŒw�qŒz˜DÑ ˆˆØ �ŠˆØˆˆØ Ð Ø�t‰|ˆˆà�t�C  (¡ ™OœOÑ+¨EÑ1Ñ1ˆà ˆq‚y€yÝŒ Ð9Ý$°ð 4ñ 4ô 4ð 4àˆàˆˆQˆQˆQ�ˆWŒÑ€AØ€yØŒcˆˆà�‰sŒgˆÝ ˆAˆs�xŠx‰zŒzÑÔ€AØ�Œ˜˜4Ñ Ô Ñ €AØ �9Š9‰;Œ;Ðrfcó —||fSr_rh)rìrÉr/r0r1rÓs rdÚ_corrcoef_dispatcherrJÀ s €à ˆqˆ6€Mrfcóü—|tjus|tjurtjdtd¬¦«t ||||¬¦«} t |¦«}n#t$r||z cYSwxYwt|j ¦«}||dd…dfz}||ddd…fz}tj |j dd|j ¬¦«tj |¦«r"tj |j dd|j ¬¦«|S) ai Return Pearson product-moment correlation coefficients. Please refer to the documentation for `cov` for more detail. The relationship between the correlation coefficient matrix, `R`, and the covariance matrix, `C`, is .. math:: R_{ij} = \frac{ C_{ij} } { \sqrt{ C_{ii} C_{jj} } } The values of `R` are between -1 and 1, inclusive. Parameters ---------- x : array_like A 1-D or 2-D array containing multiple variables and observations. Each row of `x` represents a variable, and each column a single observation of all those variables. Also see `rowvar` below. y : array_like, optional An additional set of variables and observations. `y` has the same shape as `x`. rowvar : bool, optional If `rowvar` is True (default), then each row represents a variable, with observations in the columns. Otherwise, the relationship is transposed: each column represents a variable, while the rows contain observations. bias : _NoValue, optional Has no effect, do not use. .. deprecated:: 1.10.0 ddof : _NoValue, optional Has no effect, do not use. .. deprecated:: 1.10.0 dtype : data-type, optional Data-type of the result. By default, the return data-type will have at least `numpy.float64` precision. .. versionadded:: 1.20 Returns ------- R : ndarray The correlation coefficient matrix of the variables. See Also -------- cov : Covariance matrix Notes ----- Due to floating point rounding the resulting array may not be Hermitian, the diagonal elements may not be 1, and the elements may not satisfy the inequality abs(a) <= 1. The real and imaginary parts are clipped to the interval [-1, 1] in an attempt to improve on that situation but is not much help in the complex case. This function accepts but discards arguments `bias` and `ddof`. This is for backwards compatibility with previous versions of this function. These arguments had no effect on the return values of the function and can be safely ignored in this and previous versions of numpy. Examples -------- In this example we generate two random arrays, ``xarr`` and ``yarr``, and compute the row-wise and column-wise Pearson correlation coefficients, ``R``. Since ``rowvar`` is true by default, we first find the row-wise Pearson correlation coefficients between the variables of ``xarr``. >>> import numpy as np >>> rng = np.random.default_rng(seed=42) >>> xarr = rng.random((3, 3)) >>> xarr array([[0.77395605, 0.43887844, 0.85859792], [0.69736803, 0.09417735, 0.97562235], [0.7611397 , 0.78606431, 0.12811363]]) >>> R1 = np.corrcoef(xarr) >>> R1 array([[ 1. , 0.99256089, -0.68080986], [ 0.99256089, 1. , -0.76492172], [-0.68080986, -0.76492172, 1. ]]) If we add another set of variables and observations ``yarr``, we can compute the row-wise Pearson correlation coefficients between the variables in ``xarr`` and ``yarr``. >>> yarr = rng.random((3, 3)) >>> yarr array([[0.45038594, 0.37079802, 0.92676499], [0.64386512, 0.82276161, 0.4434142 ], [0.22723872, 0.55458479, 0.06381726]]) >>> R2 = np.corrcoef(xarr, yarr) >>> R2 array([[ 1. , 0.99256089, -0.68080986, 0.75008178, -0.934284 , -0.99004057], [ 0.99256089, 1. , -0.76492172, 0.82502011, -0.97074098, -0.99981569], [-0.68080986, -0.76492172, 1. , -0.99507202, 0.89721355, 0.77714685], [ 0.75008178, 0.82502011, -0.99507202, 1. , -0.93657855, -0.83571711], [-0.934284 , -0.97074098, 0.89721355, -0.93657855, 1. , 0.97517215], [-0.99004057, -0.99981569, 0.77714685, -0.83571711, 0.97517215, 1. ]]) Finally if we use the option ``rowvar=False``, the columns are now being treated as the variables and we will find the column-wise Pearson correlation coefficients between variables in ``xarr`` and ``yarr``. >>> R3 = np.corrcoef(xarr, yarr, rowvar=False) >>> R3 array([[ 1. , 0.77598074, -0.47458546, -0.75078643, -0.9665554 , 0.22423734], [ 0.77598074, 1. , -0.92346708, -0.99923895, -0.58826587, -0.44069024], [-0.47458546, -0.92346708, 1. , 0.93773029, 0.23297648, 0.75137473], [-0.75078643, -0.99923895, 0.93773029, 1. , 0.55627469, 0.47536961], [-0.9665554 , -0.58826587, 0.23297648, 0.55627469, 1. , -0.46666491], [ 0.22423734, -0.44069024, 0.75137473, 0.47536961, -0.46666491, 1. ]]) z/bias and ddof have no effect and are deprecatedrr8rÔNr¿rq©r?) r�rÕr>r?ÚDeprecationWarningrLr+r·rrhÚcliprWrg) rìrÉr/r0r1rÓrDÚdÚstddevs rdrMrMÅ s€ð@ •2”;ÐР$­b¬kÐ"9Ð"9åŒ ÐGÝ(°Qð 8ñ 8ô 8ð 8å ˆAˆq�& Ð&Ñ&Ô&€AðÝ �‰GŒGˆˆøÝ ðððð�1‰uˆ ˆ ˆ ðøøøõ�!”&‰\Œ\€F؈����4�ŒÑ€A؈��a�a�a�ŒÑ€Aõ „GˆAŒF�B˜˜qœvÐ&Ñ&Ô&Ð&Ý „�qÑÔð+Ý Œ�”˜˜A 1¤6Ð*Ñ*Ô*Ð*à €HsÁ AÁA/Á.A/cód—tjd|g¦«}|d}|dkrtg|j¬¦«S|dkrtd|j¬¦«St d|z |d¦«}ddt t |z|dz z ¦«zzdt dt z|z|dz z ¦«zzS) a Return the Blackman window. The Blackman window is a taper formed by using the first three terms of a summation of cosines. It was designed to have close to the minimal leakage possible. It is close to optimal, only slightly worse than a Kaiser window. Parameters ---------- M : int Number of points in the output window. If zero or less, an empty array is returned. Returns ------- out : ndarray The window, with the maximum value normalized to one (the value one appears only if the number of samples is odd). See Also -------- bartlett, hamming, hanning, kaiser Notes ----- The Blackman window is defined as .. math:: w(n) = 0.42 - 0.5 \cos(2\pi n/M) + 0.08 \cos(4\pi n/M) Most references to the Blackman window come from the signal processing literature, where it is used as one of many windowing functions for smoothing values. It is also known as an apodization (which means "removing the foot", i.e. smoothing discontinuities at the beginning and end of the sampled signal) or tapering function. It is known as a "near optimal" tapering function, almost as good (by some measures) as the kaiser window. References ---------- Blackman, R.B. and Tukey, J.W., (1958) The measurement of power spectra, Dover Publications, New York. Oppenheim, A.V., and R.W. Schafer. Discrete-Time Signal Processing. Upper Saddle River, NJ: Prentice-Hall, 1999, pp. 468-471. Examples -------- >>> import matplotlib.pyplot as plt >>> np.blackman(12) array([-1.38777878e-17, 3.26064346e-02, 1.59903635e-01, # may vary 4.14397981e-01, 7.36045180e-01, 9.67046769e-01, 9.67046769e-01, 7.36045180e-01, 4.14397981e-01, 1.59903635e-01, 3.26064346e-02, -1.38777878e-17]) Plot the window and the frequency response: >>> from numpy.fft import fft, fftshift >>> window = np.blackman(51) >>> plt.plot(window) [] >>> plt.title("Blackman window") Text(0.5, 1.0, 'Blackman window') >>> plt.ylabel("Amplitude") Text(0, 0.5, 'Amplitude') >>> plt.xlabel("Sample") Text(0.5, 0, 'Sample') >>> plt.show() >>> plt.figure()
>>> A = fft(window, 2048) / 25.5 >>> mag = np.abs(fftshift(A)) >>> freq = np.linspace(-0.5, 0.5, len(A)) >>> with np.errstate(divide='ignore', invalid='ignore'): ... response = 20 * np.log10(mag) ... >>> response = np.clip(response, -100, 100) >>> plt.plot(freq, response) [] >>> plt.title("Frequency response of Blackman window") Text(0.5, 1.0, 'Frequency response of Blackman window') >>> plt.ylabel("Magnitude [dB]") Text(0, 0.5, 'Magnitude [dB]') >>> plt.xlabel("Normalized frequency [cycles per sample]") Text(0.5, 0, 'Normalized frequency [cycles per sample]') >>> _ = plt.axis('tight') >>> plt.show() r™rqrÔrgáz®GáÚ?rtg{®Gáz´?r$©r�r rÓrrrr©ÚMÚvaluesrbs rdrTrT^ s¶€õ|ŒX�s˜A�hÑ Ô €F؈qŒ €Aàˆ1‚u€uÝ�R˜vœ|Ð,Ñ,Ô,Ð,؈A‚v€vÝ�A˜Vœ\Ð*Ñ*Ô*Ð*݈q�‰s�A�qÑÔ€AØ �#•c�"˜Q™$  !¡™*‘o”oÑ%Ñ %¨­S°µR±¸±¸1¸Q¹3±Ñ-@Ô-@Ñ(@Ñ @Ð@rfcó8—tjd|g¦«}|d}|dkrtg|j¬¦«S|dkrtd|j¬¦«St d|z |d¦«}t t |d¦«d||dz z zd||dz z z ¦«S)a6 Return the Bartlett window. The Bartlett window is very similar to a triangular window, except that the end points are at zero. It is often used in signal processing for tapering a signal, without generating too much ripple in the frequency domain. Parameters ---------- M : int Number of points in the output window. If zero or less, an empty array is returned. Returns ------- out : array The triangular window, with the maximum value normalized to one (the value one appears only if the number of samples is odd), with the first and last samples equal to zero. See Also -------- blackman, hamming, hanning, kaiser Notes ----- The Bartlett window is defined as .. math:: w(n) = \frac{2}{M-1} \left( \frac{M-1}{2} - \left|n - \frac{M-1}{2}\right| \right) Most references to the Bartlett window come from the signal processing literature, where it is used as one of many windowing functions for smoothing values. Note that convolution with this window produces linear interpolation. It is also known as an apodization (which means "removing the foot", i.e. smoothing discontinuities at the beginning and end of the sampled signal) or tapering function. The Fourier transform of the Bartlett window is the product of two sinc functions. Note the excellent discussion in Kanasewich [2]_. References ---------- .. [1] M.S. Bartlett, "Periodogram Analysis and Continuous Spectra", Biometrika 37, 1-16, 1950. .. [2] E.R. Kanasewich, "Time Sequence Analysis in Geophysics", The University of Alberta Press, 1975, pp. 109-110. .. [3] A.V. Oppenheim and R.W. Schafer, "Discrete-Time Signal Processing", Prentice-Hall, 1999, pp. 468-471. .. [4] Wikipedia, "Window function", https://en.wikipedia.org/wiki/Window_function .. [5] W.H. Press, B.P. Flannery, S.A. Teukolsky, and W.T. Vetterling, "Numerical Recipes", Cambridge University Press, 1986, page 429. Examples -------- >>> import matplotlib.pyplot as plt >>> np.bartlett(12) array([ 0. , 0.18181818, 0.36363636, 0.54545455, 0.72727273, # may vary 0.90909091, 0.90909091, 0.72727273, 0.54545455, 0.36363636, 0.18181818, 0. ]) Plot the window and its frequency response (requires SciPy and matplotlib): >>> from numpy.fft import fft, fftshift >>> window = np.bartlett(51) >>> plt.plot(window) [] >>> plt.title("Bartlett window") Text(0.5, 1.0, 'Bartlett window') >>> plt.ylabel("Amplitude") Text(0, 0.5, 'Amplitude') >>> plt.xlabel("Sample") Text(0.5, 0, 'Sample') >>> plt.show() >>> plt.figure()
>>> A = fft(window, 2048) / 25.5 >>> mag = np.abs(fftshift(A)) >>> freq = np.linspace(-0.5, 0.5, len(A)) >>> with np.errstate(divide='ignore', invalid='ignore'): ... response = 20 * np.log10(mag) ... >>> response = np.clip(response, -100, 100) >>> plt.plot(freq, response) [] >>> plt.title("Frequency response of Bartlett window") Text(0.5, 1.0, 'Frequency response of Bartlett window') >>> plt.ylabel("Magnitude [dB]") Text(0, 0.5, 'Magnitude [dB]') >>> plt.xlabel("Normalized frequency [cycles per sample]") Text(0.5, 0, 'Normalized frequency [cycles per sample]') >>> _ = plt.axis('tight') >>> plt.show() r™rqrÔrr)r�r rÓrrrrrSs rdrSrSÇ s¦€õLŒX�s˜A�hÑ Ô €F؈qŒ €Aàˆ1‚u€uÝ�R˜vœ|Ð,Ñ,Ô,Ð,؈A‚v€vÝ�A˜Vœ\Ð*Ñ*Ô*Ð*݈q�‰s�A�qÑÔ€AÝ •˜A˜qÑ!Ô! 1 q¨!¨A©#¡w¡;°°A°q¸±s±G± Ñ <Ô <Ð>> np.hanning(12) array([0. , 0.07937323, 0.29229249, 0.57115742, 0.82743037, 0.97974649, 0.97974649, 0.82743037, 0.57115742, 0.29229249, 0.07937323, 0. ]) Plot the window and its frequency response: >>> import matplotlib.pyplot as plt >>> from numpy.fft import fft, fftshift >>> window = np.hanning(51) >>> plt.plot(window) [] >>> plt.title("Hann window") Text(0.5, 1.0, 'Hann window') >>> plt.ylabel("Amplitude") Text(0, 0.5, 'Amplitude') >>> plt.xlabel("Sample") Text(0.5, 0, 'Sample') >>> plt.show() >>> plt.figure()
>>> A = fft(window, 2048) / 25.5 >>> mag = np.abs(fftshift(A)) >>> freq = np.linspace(-0.5, 0.5, len(A)) >>> with np.errstate(divide='ignore', invalid='ignore'): ... response = 20 * np.log10(mag) ... >>> response = np.clip(response, -100, 100) >>> plt.plot(freq, response) [] >>> plt.title("Frequency response of the Hann window") Text(0.5, 1.0, 'Frequency response of the Hann window') >>> plt.ylabel("Magnitude [dB]") Text(0, 0.5, 'Magnitude [dB]') >>> plt.xlabel("Normalized frequency [cycles per sample]") Text(0.5, 0, 'Normalized frequency [cycles per sample]') >>> plt.axis('tight') ... >>> plt.show() r™rqrÔrrtrRrSs rdrRrR8 s”€õDŒX�s˜A�hÑ Ô €F؈qŒ €Aàˆ1‚u€uÝ�R˜vœ|Ð,Ñ,Ô,Ð,؈A‚v€vÝ�A˜Vœ\Ð*Ñ*Ô*Ð*݈q�‰s�A�qÑÔ€AØ �•S�˜A™˜q ™s™‘_”_Ñ$Ñ $Ð$rfcó—tjd|g¦«}|d}|dkrtg|j¬¦«S|dkrtd|j¬¦«St d|z |d¦«}ddt t |z|dz z ¦«zzS)a_ Return the Hamming window. The Hamming window is a taper formed by using a weighted cosine. Parameters ---------- M : int Number of points in the output window. If zero or less, an empty array is returned. Returns ------- out : ndarray The window, with the maximum value normalized to one (the value one appears only if the number of samples is odd). See Also -------- bartlett, blackman, hanning, kaiser Notes ----- The Hamming window is defined as .. math:: w(n) = 0.54 - 0.46\cos\left(\frac{2\pi{n}}{M-1}\right) \qquad 0 \leq n \leq M-1 The Hamming was named for R. W. Hamming, an associate of J. W. Tukey and is described in Blackman and Tukey. It was recommended for smoothing the truncated autocovariance function in the time domain. Most references to the Hamming window come from the signal processing literature, where it is used as one of many windowing functions for smoothing values. It is also known as an apodization (which means "removing the foot", i.e. smoothing discontinuities at the beginning and end of the sampled signal) or tapering function. References ---------- .. [1] Blackman, R.B. and Tukey, J.W., (1958) The measurement of power spectra, Dover Publications, New York. .. [2] E.R. Kanasewich, "Time Sequence Analysis in Geophysics", The University of Alberta Press, 1975, pp. 109-110. .. [3] Wikipedia, "Window function", https://en.wikipedia.org/wiki/Window_function .. [4] W.H. Press, B.P. Flannery, S.A. Teukolsky, and W.T. Vetterling, "Numerical Recipes", Cambridge University Press, 1986, page 425. Examples -------- >>> np.hamming(12) array([ 0.08 , 0.15302337, 0.34890909, 0.60546483, 0.84123594, # may vary 0.98136677, 0.98136677, 0.84123594, 0.60546483, 0.34890909, 0.15302337, 0.08 ]) Plot the window and the frequency response: >>> import matplotlib.pyplot as plt >>> from numpy.fft import fft, fftshift >>> window = np.hamming(51) >>> plt.plot(window) [] >>> plt.title("Hamming window") Text(0.5, 1.0, 'Hamming window') >>> plt.ylabel("Amplitude") Text(0, 0.5, 'Amplitude') >>> plt.xlabel("Sample") Text(0.5, 0, 'Sample') >>> plt.show() >>> plt.figure()
>>> A = fft(window, 2048) / 25.5 >>> mag = np.abs(fftshift(A)) >>> freq = np.linspace(-0.5, 0.5, len(A)) >>> response = 20 * np.log10(mag) >>> response = np.clip(response, -100, 100) >>> plt.plot(freq, response) [] >>> plt.title("Frequency response of Hamming window") Text(0.5, 1.0, 'Frequency response of Hamming window') >>> plt.ylabel("Magnitude [dB]") Text(0, 0.5, 'Magnitude [dB]') >>> plt.xlabel("Normalized frequency [cycles per sample]") Text(0.5, 0, 'Normalized frequency [cycles per sample]') >>> plt.axis('tight') ... >>> plt.show() r™rqrÔrgHáz®Gá?gq= ×£pÝ?rRrSs rdrQrQ¥ s”€õ|ŒX�s˜A�hÑ Ô €F؈qŒ €Aàˆ1‚u€uÝ�R˜vœ|Ð,Ñ,Ô,Ð,؈A‚v€vÝ�A˜Vœ\Ð*Ñ*Ô*Ð*݈q�‰s�A�qÑÔ€AØ �$•s�2˜a™4  1¡™:‘”Ñ&Ñ &Ð&rf)gïÐ4!·\T¼g‰¥}—b3ƒg«0 ŒöêK¾g5dM�v;p>g�"�c쑾g¬ôŒ—$¿²>g'd¥Ëo†Ò¾gY(š¾X?ñ>gZÄY&+¿g«|tµ(?gRëýâB¿gŠuÜZ?gI¨ ^¶q¿gÝãÝóa™…?gð¶!ñžN˜¿g-£¨ÎŠ>©?gê-4pK¸¿gÀˆ¬w¬÷Å?g�ÍWÀëÓ¿g*¢5�N¨å?)g‹ÊT·­`¼g0‘fÚFV¼g!„Ù¾‰g‡["©d,->gmÕÖ€’VX>gnaÍÙ€‹>g†ÅÁ+AÈ>gRž™x£?gI�墌™k?gË ¨¬b¾é?có�—|d}d}tdt|¦«¦«D]}|}|}||z|z ||z}Œd||z zS)Nrr™rqrt)r&r¶)rìrÿÚb0Úb1rÚb2s rdÚ_chbevlr]N s_€Ø ˆaŒ€BØ €Bå �1•c˜$‘i”iÑ Ô ð!ð!ˆØ ˆØ ˆØ ˆr‰T�B‰Y˜˜aœÑ ˆˆà ��R‘‰=ÐrfcóX—t|¦«t|dz dz t¦«zS)Nr$r)rr]Ú_i0A©rìs rdÚ_i0_1raZ s%€Ý ˆq‰6Œ6•G˜A˜c™E !™G¥TÑ*Ô*Ñ *Ð*rfcóx—t|¦«td|z dz t¦«zt|¦«z S)Ng@@r$)rr]Ú_i0Brr`s rdÚ_i0_2rd^ s0€Ý ˆq‰6Œ6•G˜D ™F S™L­$Ñ/Ô/Ñ /µ$°q±'´'Ñ 9Ð9rfcó—|fSr_rhr`s rdÚ_i0_dispatcherrfb r±rfcó(—tj|¦«}|jjdkrt d¦«‚|jjdkr| t ¦«}tj|¦«}t||dkgttg¦«S)a Modified Bessel function of the first kind, order 0. Usually denoted :math:`I_0`. Parameters ---------- x : array_like of float Argument of the Bessel function. Returns ------- out : ndarray, shape = x.shape, dtype = float The modified Bessel function evaluated at each of the elements of `x`. See Also -------- scipy.special.i0, scipy.special.iv, scipy.special.ive Notes ----- The scipy implementation is recommended over this function: it is a proper ufunc written in C, and more than an order of magnitude faster. We use the algorithm published by Clenshaw [1]_ and referenced by Abramowitz and Stegun [2]_, for which the function domain is partitioned into the two intervals [0,8] and (8,inf), and Chebyshev polynomial expansions are employed in each interval. Relative error on the domain [0,30] using IEEE arithmetic is documented [3]_ as having a peak of 5.8e-16 with an rms of 1.4e-16 (n = 30000). References ---------- .. [1] C. W. Clenshaw, "Chebyshev series for mathematical functions", in *National Physical Laboratory Mathematical Tables*, vol. 5, London: Her Majesty's Stationery Office, 1962. .. [2] M. Abramowitz and I. A. Stegun, *Handbook of Mathematical Functions*, 10th printing, New York: Dover, 1964, pp. 379. https://personal.math.ubc.ca/~cbm/aands/page_379.htm .. [3] https://metacpan.org/pod/distribution/Math-Cephes/lib/Math/Cephes.pod#i0:-Modified-Bessel-function-of-order-zero Examples -------- >>> np.i0(0.) array(1.0) >>> np.i0([0, 1, 2, 3]) array([1. , 1.26606588, 2.2795853 , 4.88079259]) rDz#i0 not supported for complex valuesrg @) r�r rÓÚkindrÈr’r<r[r9rardr`s rdrWrWf sy€õf Œ �aÑÔ€AØ„w„|�sÒÐÝÐ=Ñ>Ô>Ð>Ø„w„|�sÒÐØ �HŠH•U‰OŒOˆÝ Œˆq‰ Œ €AÝ �Q˜˜cš˜ ¥U­E NÑ 3Ô 3Ð3rfcó8—tjd||g¦«}|d}|d}|dkrtjd|j¬¦«St d|¦«}|dz dz }t |t d||z |z dzz ¦«z¦«t |¦«z S)aô Return the Kaiser window. The Kaiser window is a taper formed by using a Bessel function. Parameters ---------- M : int Number of points in the output window. If zero or less, an empty array is returned. beta : float Shape parameter for window. Returns ------- out : array The window, with the maximum value normalized to one (the value one appears only if the number of samples is odd). See Also -------- bartlett, blackman, hamming, hanning Notes ----- The Kaiser window is defined as .. math:: w(n) = I_0\left( \beta \sqrt{1-\frac{4n^2}{(M-1)^2}} \right)/I_0(\beta) with .. math:: \quad -\frac{M-1}{2} \leq n \leq \frac{M-1}{2}, where :math:`I_0` is the modified zeroth-order Bessel function. The Kaiser was named for Jim Kaiser, who discovered a simple approximation to the DPSS window based on Bessel functions. The Kaiser window is a very good approximation to the Digital Prolate Spheroidal Sequence, or Slepian window, which is the transform which maximizes the energy in the main lobe of the window relative to total energy. The Kaiser can approximate many other windows by varying the beta parameter. ==== ======================= beta Window shape ==== ======================= 0 Rectangular 5 Similar to a Hamming 6 Similar to a Hanning 8.6 Similar to a Blackman ==== ======================= A beta value of 14 is probably a good starting point. Note that as beta gets large, the window narrows, and so the number of samples needs to be large enough to sample the increasingly narrow spike, otherwise NaNs will get returned. Most references to the Kaiser window come from the signal processing literature, where it is used as one of many windowing functions for smoothing values. It is also known as an apodization (which means "removing the foot", i.e. smoothing discontinuities at the beginning and end of the sampled signal) or tapering function. References ---------- .. [1] J. F. Kaiser, "Digital Filters" - Ch 7 in "Systems analysis by digital computer", Editors: F.F. Kuo and J.F. Kaiser, p 218-285. John Wiley and Sons, New York, (1966). .. [2] E.R. Kanasewich, "Time Sequence Analysis in Geophysics", The University of Alberta Press, 1975, pp. 177-178. .. [3] Wikipedia, "Window function", https://en.wikipedia.org/wiki/Window_function Examples -------- >>> import matplotlib.pyplot as plt >>> np.kaiser(12, 14) array([7.72686684e-06, 3.46009194e-03, 4.65200189e-02, # may vary 2.29737120e-01, 5.99885316e-01, 9.45674898e-01, 9.45674898e-01, 5.99885316e-01, 2.29737120e-01, 4.65200189e-02, 3.46009194e-03, 7.72686684e-06]) Plot the window and the frequency response: >>> from numpy.fft import fft, fftshift >>> window = np.kaiser(51, 14) >>> plt.plot(window) [] >>> plt.title("Kaiser window") Text(0.5, 1.0, 'Kaiser window') >>> plt.ylabel("Amplitude") Text(0, 0.5, 'Amplitude') >>> plt.xlabel("Sample") Text(0.5, 0, 'Sample') >>> plt.show() >>> plt.figure()
>>> A = fft(window, 2048) / 25.5 >>> mag = np.abs(fftshift(A)) >>> freq = np.linspace(-0.5, 0.5, len(A)) >>> response = 20 * np.log10(mag) >>> response = np.clip(response, -100, 100) >>> plt.plot(freq, response) [] >>> plt.title("Frequency response of Kaiser window") Text(0.5, 1.0, 'Frequency response of Kaiser window') >>> plt.ylabel("Magnitude [dB]") Text(0, 0.5, 'Magnitude [dB]') >>> plt.xlabel("Normalized frequency [cycles per sample]") Text(0.5, 0, 'Normalized frequency [cycles per sample]') >>> plt.axis('tight') (-0.5, 0.5, -100.0, ...) # may vary >>> plt.show() r™rqrrÔrr$)r�r rrÓrrWr)rTÚbetarUrbÚalphas rdrUrU¤ sž€õzŒX�s˜A˜t�nÑ %Ô %€F؈qŒ €AØ �!Œ9€DàˆA‚v€vÝŒw�q ¤ Ð-Ñ-Ô-Ð-݈q�!‰ Œ €AØ ˆq‰S�#‰I€EÝ ˆd•T˜!˜a ™g u™_¨sÑ2Ñ2Ñ3Ô3Ñ3Ñ 4Ô 4µR¸±X´XÑ =Ð=rfcó—|fSr_rhr`s rdÚ_sinc_dispatcherrm,r±rfcóˆ—tj|¦«}tt|dkd|¦«z}t |¦«|z S)aã Return the normalized sinc function. The sinc function is equal to :math:`\sin(\pi x)/(\pi x)` for any argument :math:`x\ne 0`. ``sinc(0)`` takes the limit value 1, making ``sinc`` not only everywhere continuous but also infinitely differentiable. .. note:: Note the normalization factor of ``pi`` used in the definition. This is the most commonly used definition in signal processing. Use ``sinc(x / np.pi)`` to obtain the unnormalized sinc function :math:`\sin(x)/x` that is more common in mathematics. Parameters ---------- x : ndarray Array (possibly multi-dimensional) of values for which to calculate ``sinc(x)``. Returns ------- out : ndarray ``sinc(x)``, which has the same shape as the input. Notes ----- The name sinc is short for "sine cardinal" or "sinus cardinalis". The sinc function is used in various signal processing applications, including in anti-aliasing, in the construction of a Lanczos resampling filter, and in interpolation. For bandlimited interpolation of discrete-time signals, the ideal interpolation kernel is proportional to the sinc function. References ---------- .. [1] Weisstein, Eric W. "Sinc Function." From MathWorld--A Wolfram Web Resource. http://mathworld.wolfram.com/SincFunction.html .. [2] Wikipedia, "Sinc function", https://en.wikipedia.org/wiki/Sinc_function Examples -------- >>> import matplotlib.pyplot as plt >>> x = np.linspace(-4, 4, 41) >>> np.sinc(x) array([-3.89804309e-17, -4.92362781e-02, -8.40918587e-02, # may vary -8.90384387e-02, -5.84680802e-02, 3.89804309e-17, 6.68206631e-02, 1.16434881e-01, 1.26137788e-01, 8.50444803e-02, -3.89804309e-17, -1.03943254e-01, -1.89206682e-01, -2.16236208e-01, -1.55914881e-01, 3.89804309e-17, 2.33872321e-01, 5.04551152e-01, 7.56826729e-01, 9.35489284e-01, 1.00000000e+00, 9.35489284e-01, 7.56826729e-01, 5.04551152e-01, 2.33872321e-01, 3.89804309e-17, -1.55914881e-01, -2.16236208e-01, -1.89206682e-01, -1.03943254e-01, -3.89804309e-17, 8.50444803e-02, 1.26137788e-01, 1.16434881e-01, 6.68206631e-02, 3.89804309e-17, -5.84680802e-02, -8.90384387e-02, -8.40918587e-02, -4.92362781e-02, -3.89804309e-17]) >>> plt.plot(x, np.sinc(x)) [] >>> plt.title("Sinc Function") Text(0.5, 1.0, 'Sinc Function') >>> plt.ylabel("Amplitude") Text(0, 0.5, 'Amplitude') >>> plt.xlabel("X") Text(0.5, 0, 'X') >>> plt.show() rg#B’ ¡œÇ;)r�r rrr)rìrÉs rdrPrP0s=€õX Œ �aÑÔ€AÝ �U�1˜’6˜7 AÑ &Ô &Ñ&€AÝ ˆq‰6Œ6�!‰8€Orfcó—|fSr_rhr{s rdÚ_msort_dispatcherrp�r±rfcóŒ—tjdtd¬¦«t|dd¬¦«}| d¦«|S)a` Return a copy of an array sorted along the first axis. .. deprecated:: 1.24 msort is deprecated, use ``np.sort(a, axis=0)`` instead. Parameters ---------- a : array_like Array to be sorted. Returns ------- sorted_array : ndarray Array of the same type and shape as `a`. See Also -------- sort Notes ----- ``np.msort(a)`` is equivalent to ``np.sort(a, axis=0)``. Examples -------- >>> a = np.array([[1, 4], [3, 1]]) >>> np.msort(a) # sort along the first axis array([[1, 1], [3, 4]]) z3msort is deprecated, use np.sort(a, axis=0) insteadrr8T)rr;r)r>r?rMr r„r…s rdrNrN…sQ€õH „MØ=ÝØðñôðõ ˆa�t $Ð'Ñ'Ô'€A؇F‚Fˆ1�I„I€IØ €Hrfc óЇ —tj|¦«}| dd¦«Š | dd¦«}|tjurd}|j}‰ ��t j‰ |¦«Š |r>|�.ÚsNøèè€ð"Hð"HØ89˜˜d˜˜�A�A­¨d© ¬ ð"Hð"Hð"Hð"Hð"Hð"Hrfrqr©r¿r¿rc3óV•K—|]#}|‰vr tjntd¦«V—Œ$dSr_)r�Únewaxisr)rts €rdr®z_ureduce..øsKøèè€ð$ð$àð  4˜i˜i•” � ­U°4©[¬[ð$ð$ð$ð$ð$ð$rf)r�r ÚgetrÕr¸rÂrÃrµr&ÚEllipsisr¶rãr ÚsortedrÜr;rvrw)rÌrþrÊrìr?rLÚ index_outÚkeepÚnkeeprÚsÚrÚindex_rr¼s @rdÚ_ureducer�³s3ø€õ4 Œ �aÑÔ€AØ �:Š:�f˜dÑ #Ô #€DØ �*Š*�U˜DÑ !Ô !€Cà•2”;ÐÐØˆà Œ€BØ ÑÝÔ'¨¨bÑ1Ô1ˆà ð >؈Ý!ð"Hð"Hð"Hð"HÝ=BÀ2¹Y¼Yð"Hñ"Hô"HñHôH� à #¥X L°9Ñ$<Ô =��u‘ å ˆt‰9Œ9˜Š>ˆ>Ø! !œWˆF�6‰NˆNå•u˜R‘y”y‘>”>¥C¨¡I¤IÑ-ˆDݘ‘I”IˆEå!¥&¨¡,¤,Ñ/Ô/ð %ð %‘��1Ø—J’J˜q !Ñ$Ô$��à— ’ ˜!œ' & 5 &œ/¨EÑ1Ñ2Ô2ˆA؈F�6‰NˆNà ð >؈Ø! B™J� Ø #¥X L°9Ñ$<Ô =��u‘ à ˆˆQÐÐ�&ÐЀAà €Øˆ àð&Ø ˆ<Ý”z�n rÑ)ˆGˆGåð$ð$ð$ð$å˜r™œð$ñ$ô$ñ$ô$ˆGð �xˆl˜WÑ$Ô %ˆà €Hrfcó —||fSr_rh©rÌr¼r?Úoverwrite_inputrÊs rdÚ_median_dispatcherr…s €à ˆsˆ8€Orfcó6—t|t||||¬¦«S)a Compute the median along the specified axis. Returns the median of the array elements. Parameters ---------- a : array_like Input array or object that can be converted to an array. axis : {int, sequence of int, None}, optional Axis or axes along which the medians are computed. The default is to compute the median along a flattened version of the array. A sequence of axes is supported since version 1.9.0. out : ndarray, optional Alternative output array in which to place the result. It must have the same shape and buffer length as the expected output, but the type (of the output) will be cast if necessary. overwrite_input : bool, optional If True, then allow use of memory of input array `a` for calculations. The input array will be modified by the call to `median`. This will save memory when you do not need to preserve the contents of the input array. Treat the input as undefined, but it will probably be fully or partially sorted. Default is False. If `overwrite_input` is ``True`` and `a` is not already an `ndarray`, an error will be raised. keepdims : bool, optional If this is set to True, the axes which are reduced are left in the result as dimensions with size one. With this option, the result will broadcast correctly against the original `arr`. .. versionadded:: 1.9.0 Returns ------- median : ndarray A new array holding the result. If the input contains integers or floats smaller than ``float64``, then the output data-type is ``np.float64``. Otherwise, the data-type of the output is the same as that of the input. If `out` is specified, that array is returned instead. See Also -------- mean, percentile Notes ----- Given a vector ``V`` of length ``N``, the median of ``V`` is the middle value of a sorted copy of ``V``, ``V_sorted`` - i e., ``V_sorted[(N-1)/2]``, when ``N`` is odd, and the average of the two middle values of ``V_sorted`` when ``N`` is even. Examples -------- >>> a = np.array([[10, 7, 4], [3, 2, 1]]) >>> a array([[10, 7, 4], [ 3, 2, 1]]) >>> np.median(a) 3.5 >>> np.median(a, axis=0) array([6.5, 4.5, 2.5]) >>> np.median(a, axis=1) array([7., 2.]) >>> m = np.median(a, axis=0) >>> out = np.zeros_like(m) >>> np.median(a, axis=0, out=m) array([6.5, 4.5, 2.5]) >>> m array([6.5, 4.5, 2.5]) >>> b = a.copy() >>> np.median(b, axis=1, overwrite_input=True) array([7., 2.]) >>> assert not np.all(a==b) >>> b = a.copy() >>> np.median(b, axis=None, overwrite_input=True) 3.5 >>> assert not np.all(a==b) )rþrÊr¼r?r„)r�Ú_medianrƒs rdrOrOs)€õd �A�G¨h¸TÀsØ$3ð 5ñ 5ô 5ð5rfcó¨—tj|¦«}|€|j}n |j|}|dzdkr |dz}|dz |g}n |dz dzg}tj|jtj¦«p |jjdv}|r| d¦«|rF|€*|  ¦«}|  |¦«n,|  ||¬¦«|}nt|||¬¦«}|jdkr|  ¦«S|€d}td¦«g|j z} |j|dz} |j|dzdkrt| | dz¦«| |<nt| dz | dz¦«| |<t| ¦«} t|| ||¬¦«} |r,|dkr&tjj || |¦«} | S) NrrrqÚMmr¿rórh©r¼r?)r�r r×rvr'rÓr/rhr[r"r$Úitemr)r¸rµr%r½ÚutilsÚ_median_nancheck) rÌr¼r?r„ÚszÚszhÚkthÚ supports_nansÚpartrÄr›Úrouts rdr‡r‡[sè€õ Œ �aÑÔ€Að €|Ø ŒVˆˆà ŒW�TŒ]ˆØ ˆA�v�‚{€{Ø�A‰gˆØ�Q‰w˜ˆnˆˆà�Q‘˜1‰}ˆoˆõ”M !¤'­2¬:Ñ6Ô6ÐN¸!¼'¼,È$Ð:N€MØðØ � Š �2‰Œˆàð,Ø ˆ<Ø—7’7‘9”9ˆDØ �NŠN˜3Ñ Ô Ð Ð à �KŠK˜ $ˆKÑ 'Ô 'Ð '؈DˆD嘘C dÐ+Ñ+Ô+ˆà „z�RÒÐà�yŠy‰{Œ{ÐØ €|؈å�T‰{Œ{ˆm˜dœiÑ'€GØ ŒJ�tÔ  Ñ !€EØ „z�$Ô˜!јqÒ Ð å˜e U¨1¡WÑ-Ô-ˆ�‰ ˆ å˜e A™g u¨Q¡wÑ/Ô/ˆ�‰ Ý�G‰nŒn€Gõ ��W”  D¨cÐ 2Ñ 2Ô 2€DØð?˜˜aš˜åŒvŒ|×,Ò,¨T°4¸Ñ>Ô>ˆà €Krf)Ú interpolationcó —|||fSr_rh©rÌÚqr¼r?r„ÚmethodrÊr”s rdÚ_percentile_dispatcherr™“ó€à ˆq�#ˆ;Ðrfr¥c ó<—|�t||d¦«}tj|¦«}|jjdkrt d¦«‚tj|d¦«}t|¦«}t|¦«std¦«‚t|||||||¦«S)aý" Compute the q-th percentile of the data along the specified axis. Returns the q-th percentile(s) of the array elements. Parameters ---------- a : array_like of real numbers Input array or object that can be converted to an array. q : array_like of float Percentage or sequence of percentages for the percentiles to compute. Values must be between 0 and 100 inclusive. axis : {int, tuple of int, None}, optional Axis or axes along which the percentiles are computed. The default is to compute the percentile(s) along a flattened version of the array. .. versionchanged:: 1.9.0 A tuple of axes is supported out : ndarray, optional Alternative output array in which to place the result. It must have the same shape and buffer length as the expected output, but the type (of the output) will be cast if necessary. overwrite_input : bool, optional If True, then allow the input array `a` to be modified by intermediate calculations, to save memory. In this case, the contents of the input `a` after this function completes is undefined. method : str, optional This parameter specifies the method to use for estimating the percentile. There are many different methods, some unique to NumPy. See the notes for explanation. The options sorted by their R type as summarized in the H&F paper [1]_ are: 1. 'inverted_cdf' 2. 'averaged_inverted_cdf' 3. 'closest_observation' 4. 'interpolated_inverted_cdf' 5. 'hazen' 6. 'weibull' 7. 'linear' (default) 8. 'median_unbiased' 9. 'normal_unbiased' The first three methods are discontinuous. NumPy further defines the following discontinuous variations of the default 'linear' (7.) option: * 'lower' * 'higher', * 'midpoint' * 'nearest' .. versionchanged:: 1.22.0 This argument was previously called "interpolation" and only offered the "linear" default and last four options. keepdims : bool, optional If this is set to True, the axes which are reduced are left in the result as dimensions with size one. With this option, the result will broadcast correctly against the original array `a`. .. versionadded:: 1.9.0 interpolation : str, optional Deprecated name for the method keyword argument. .. deprecated:: 1.22.0 Returns ------- percentile : scalar or ndarray If `q` is a single percentile and `axis=None`, then the result is a scalar. If multiple percentiles are given, first axis of the result corresponds to the percentiles. The other axes are the axes that remain after the reduction of `a`. If the input contains integers or floats smaller than ``float64``, the output data-type is ``float64``. Otherwise, the output data-type is the same as that of the input. If `out` is specified, that array is returned instead. See Also -------- mean median : equivalent to ``percentile(..., 50)`` nanpercentile quantile : equivalent to percentile, except q in the range [0, 1]. Notes ----- Given a vector ``V`` of length ``n``, the q-th percentile of ``V`` is the value ``q/100`` of the way from the minimum to the maximum in a sorted copy of ``V``. The values and distances of the two nearest neighbors as well as the `method` parameter will determine the percentile if the normalized ranking does not match the location of ``q`` exactly. This function is the same as the median if ``q=50``, the same as the minimum if ``q=0`` and the same as the maximum if ``q=100``. The optional `method` parameter specifies the method to use when the desired percentile lies between two indexes ``i`` and ``j = i + 1``. In that case, we first determine ``i + g``, a virtual index that lies between ``i`` and ``j``, where ``i`` is the floor and ``g`` is the fractional part of the index. The final result is, then, an interpolation of ``a[i]`` and ``a[j]`` based on ``g``. During the computation of ``g``, ``i`` and ``j`` are modified using correction constants ``alpha`` and ``beta`` whose choices depend on the ``method`` used. Finally, note that since Python uses 0-based indexing, the code subtracts another 1 from the index internally. The following formula determines the virtual index ``i + g``, the location of the percentile in the sorted sample: .. math:: i + g = (q / 100) * ( n - alpha - beta + 1 ) + alpha The different methods then work as follows inverted_cdf: method 1 of H&F [1]_. This method gives discontinuous results: * if g > 0 ; then take j * if g = 0 ; then take i averaged_inverted_cdf: method 2 of H&F [1]_. This method give discontinuous results: * if g > 0 ; then take j * if g = 0 ; then average between bounds closest_observation: method 3 of H&F [1]_. This method give discontinuous results: * if g > 0 ; then take j * if g = 0 and index is odd ; then take j * if g = 0 and index is even ; then take i interpolated_inverted_cdf: method 4 of H&F [1]_. This method give continuous results using: * alpha = 0 * beta = 1 hazen: method 5 of H&F [1]_. This method give continuous results using: * alpha = 1/2 * beta = 1/2 weibull: method 6 of H&F [1]_. This method give continuous results using: * alpha = 0 * beta = 0 linear: method 7 of H&F [1]_. This method give continuous results using: * alpha = 1 * beta = 1 median_unbiased: method 8 of H&F [1]_. This method is probably the best method if the sample distribution function is unknown (see reference). This method give continuous results using: * alpha = 1/3 * beta = 1/3 normal_unbiased: method 9 of H&F [1]_. This method is probably the best method if the sample distribution function is known to be normal. This method give continuous results using: * alpha = 3/8 * beta = 3/8 lower: NumPy method kept for backwards compatibility. Takes ``i`` as the interpolation point. higher: NumPy method kept for backwards compatibility. Takes ``j`` as the interpolation point. nearest: NumPy method kept for backwards compatibility. Takes ``i`` or ``j``, whichever is nearest. midpoint: NumPy method kept for backwards compatibility. Uses ``(i + j) / 2``. Examples -------- >>> a = np.array([[10, 7, 4], [3, 2, 1]]) >>> a array([[10, 7, 4], [ 3, 2, 1]]) >>> np.percentile(a, 50) 3.5 >>> np.percentile(a, 50, axis=0) array([6.5, 4.5, 2.5]) >>> np.percentile(a, 50, axis=1) array([7., 2.]) >>> np.percentile(a, 50, axis=1, keepdims=True) array([[7.], [2.]]) >>> m = np.percentile(a, 50, axis=0) >>> out = np.zeros_like(m) >>> np.percentile(a, 50, axis=0, out=out) array([6.5, 4.5, 2.5]) >>> m array([6.5, 4.5, 2.5]) >>> b = a.copy() >>> np.percentile(b, 50, axis=1, overwrite_input=True) array([7., 2.]) >>> assert not np.all(a == b) The different methods can be visualized graphically: .. plot:: import matplotlib.pyplot as plt a = np.arange(4) p = np.linspace(0, 100, 6001) ax = plt.gca() lines = [ ('linear', '-', 'C0'), ('inverted_cdf', ':', 'C1'), # Almost the same as `inverted_cdf`: ('averaged_inverted_cdf', '-.', 'C1'), ('closest_observation', ':', 'C2'), ('interpolated_inverted_cdf', '--', 'C1'), ('hazen', '--', 'C3'), ('weibull', '-.', 'C4'), ('median_unbiased', '--', 'C5'), ('normal_unbiased', '-.', 'C6'), ] for method, style, color in lines: ax.plot( p, np.percentile(a, p, method=method), label=method, linestyle=style, color=color) ax.set( title='Percentiles for different methods and data: ' + str(a), xlabel='Percentile', ylabel='Estimated percentile value', yticks=a) ax.legend(bbox_to_anchor=(1.03, 1)) plt.tight_layout() plt.show() References ---------- .. [1] R. J. Hyndman and Y. Fan, "Sample quantiles in statistical packages," The American Statistician, 50(4), pp. 361-365, 1996 Nr=rDú"a must be an array of real numbersédz)Percentiles must be in the range [0, 100]) Ú_check_interpolation_as_methodr�r rÓrhrÈrBÚ_quantile_is_validr·Ú_quantile_uncheckedr–s rdr=r=˜s­€ðnÐ Ý/Ø �M <ñ1ô1ˆõ Œ �aÑÔ€AØ„w„|�sÒÐÝÐ<Ñ=Ô=Ð=å Œ�q˜#ÑÔ€AÝ�1‰ Œ €AÝ ˜aÑ Ô ðFÝÐDÑEÔEÐEÝ Ø ˆ1ˆd�C˜¨&°(ñ <ô <ð 0 ; then take j * if g = 0 ; then take i averaged_inverted_cdf: method 2 of H&F [1]_. This method gives discontinuous results: * if g > 0 ; then take j * if g = 0 ; then average between bounds closest_observation: method 3 of H&F [1]_. This method gives discontinuous results: * if g > 0 ; then take j * if g = 0 and index is odd ; then take j * if g = 0 and index is even ; then take i interpolated_inverted_cdf: method 4 of H&F [1]_. This method gives continuous results using: * alpha = 0 * beta = 1 hazen: method 5 of H&F [1]_. This method gives continuous results using: * alpha = 1/2 * beta = 1/2 weibull: method 6 of H&F [1]_. This method gives continuous results using: * alpha = 0 * beta = 0 linear: method 7 of H&F [1]_. This method gives continuous results using: * alpha = 1 * beta = 1 median_unbiased: method 8 of H&F [1]_. This method is probably the best method if the sample distribution function is unknown (see reference). This method gives continuous results using: * alpha = 1/3 * beta = 1/3 normal_unbiased: method 9 of H&F [1]_. This method is probably the best method if the sample distribution function is known to be normal. This method gives continuous results using: * alpha = 3/8 * beta = 3/8 lower: NumPy method kept for backwards compatibility. Takes ``i`` as the interpolation point. higher: NumPy method kept for backwards compatibility. Takes ``j`` as the interpolation point. nearest: NumPy method kept for backwards compatibility. Takes ``i`` or ``j``, whichever is nearest. midpoint: NumPy method kept for backwards compatibility. Uses ``(i + j) / 2``. Examples -------- >>> a = np.array([[10, 7, 4], [3, 2, 1]]) >>> a array([[10, 7, 4], [ 3, 2, 1]]) >>> np.quantile(a, 0.5) 3.5 >>> np.quantile(a, 0.5, axis=0) array([6.5, 4.5, 2.5]) >>> np.quantile(a, 0.5, axis=1) array([7., 2.]) >>> np.quantile(a, 0.5, axis=1, keepdims=True) array([[7.], [2.]]) >>> m = np.quantile(a, 0.5, axis=0) >>> out = np.zeros_like(m) >>> np.quantile(a, 0.5, axis=0, out=out) array([6.5, 4.5, 2.5]) >>> m array([6.5, 4.5, 2.5]) >>> b = a.copy() >>> np.quantile(b, 0.5, axis=1, overwrite_input=True) array([7., 2.]) >>> assert not np.all(a == b) See also `numpy.percentile` for a visualization of most methods. References ---------- .. [1] R. J. Hyndman and Y. Fan, "Sample quantiles in statistical packages," The American Statistician, 50(4), pp. 361-365, 1996 Nr]rDrœz%Quantiles must be in the range [0, 1]) ržr�r rÓrhrÈrŸr·r r–s rdr]r]Äs €ð`Ð Ý/Ø �M :ñ/ô/ˆõ Œ �aÑÔ€AØ„w„|�sÒÐÝÐ<Ñ=Ô=Ð=å Œ �aÑÔ€AÝ ˜aÑ Ô ðBÝÐ@ÑAÔAÐAÝ Ø ˆ1ˆd�C˜¨&°(ñ <ô <ð¤>ð Ø�5Ø ˆ4rfcóp—tjd|›d�td¬¦«|dkrtd¦«‚|S)Nz!the `interpolation=` argument to z¾ was renamed to `method=`, which has additional options. Users of the modes 'nearest', 'lower', 'higher', or 'midpoint' are encouraged to review the method they used. (Deprecated NumPy 1.22)r´r8r¥zjYou shall not pass both `method` and `interpolation`! (`interpolation` is Deprecated in favor of `method`))r>r?rMrÈ)r˜r”Úfnames rdržržásh€å „Mð "¨Eð "ð "ð "õ  qð *ñ*ô*ð*ð�ÒÐåð CñDôDð Dð Ðrfrkrjcó0—||z||d|z |z zzzdz S)a0 Compute the floating point indexes of an array for the linear interpolation of quantiles. n : array_like The sample sizes. quantiles : array_like The quantiles values. alpha : float A constant used to correct the index computed. beta : float A constant used to correct the index computed. alpha and beta values depend on the chosen method (see quantile documentation) Reference: Hyndman&Fan paper "Sample Quantiles in Statistical Packages", DOI: 10.1080/00031305.1996.10473566 rqrh)rbrcrkrjs rdr€r€òs3€ð( ˆy‰=Ø �I  U¡¨TÑ!1Ñ2Ñ 2ñ à ñ ð rfcó|—tj||z ¦«}|d||¦«}tj|¦«S)a Compute gamma (a.k.a 'm' or 'weight') for the linear interpolation of quantiles. virtual_indexes : array_like The indexes where the percentile is supposed to be found in the sorted sample. previous_indexes : array_like The floor values of virtual_indexes. interpolation : dict The interpolation method chosen, which may have a specific rule modifying gamma. gamma is usually the fractional part of virtual_indexes but can be modified by the interpolation method. rn)r�r )Úvirtual_indexesÚprevious_indexesr˜rjs rdÚ _get_gammar® s?€õ" ŒM˜/Ð,<Ñ<Ñ =Ô =€EØ ˆF�;Ô   Ñ 7Ô 7€EÝ Œ=˜Ñ Ô ÐrfcóΗt||¦«}tt|||z|¬¦«¦«}t||d|z z||dk¬¦«|jdkr |€|d}|S)a Compute the linear interpolation weighted by gamma on each point of two same shape array. a : array_like Left bound. b : array_like Right bound. t : array_like The interpolation weight. out : array_like Output array. rLrqrt)r?rrNrh)r!r rr¸)rÌrCrr?Údiff_b_aÚlerp_interpolations rdÚ_lerpr²!sz€õ˜˜1‰~Œ~€Hå#¥C¨¨8°a©<¸SÐ$AÑ$AÔ$AÑBÔBÐÝ ˆQ�˜A ™EÑ"Ð(:À!ÀsÂ(ÐKÑKÔKÐKØÔ !Ò#Ð#¨¨ Ø/°Ô3ÐØ Ðrfcó`—tj||¦«}tj|||d¬¦«|S)NÚunsafe)rÚcasting)r�r r)rvrwrxrr?s rdrzrz8s2€Ý Œ'�%˜Ñ 'Ô '€CÝ„IˆcÐ$¨E¸8ÐDÑDÔDÐDØ €Jrfc óÒ—tj|¦«}|dz}||z }t|j|||||¦«¬¦« tj¦«}d||dk<|S)Nrqrur)r�r‘rzrvr’r)r›Úgamma_condition_funÚpreviousÚnextrjr s rdÚ$_discret_interpolation_to_boundariesrº>sv€ÝŒx˜‰Œ€HØ �a‰<€DØ �HÑ €EÝ  ¤ Ø(,Ø,4Ø 3Ð 3°E¸5Ñ AÔ Að ñ ô ÷#šF¥2¤7™OœOð ð €CˆˆaŠ�LØ €Jrfcó:—d„}t||zdz dz |¦«S)NcóF—|dktj|¦«dzdkzS)Nrr)r�r‘ršs rdrez&_closest_observation..Ms!€ e¨q¢jµR´X¸e±_´_ÀqÑ5HÈAÒ5MÑ%N€rfrqrt©rº©rbrcÚ gamma_funs rdr|r|Ls/€ØNÐN€IÝ /°°Y±À!Ñ0CÀcÑ0IØ09ñ ;ô ;ð;rfcó4—d„}t||zdz |¦«S)Ncó—|dkSr†rhris rdrez_inverted_cdf..Ss € %¨1¢*€rfrqr½r¾s rdr`r`Rs*€Ø-Ð-€IÝ /°°Y±À!Ñ0CØ09ñ ;ô ;ð;rfrÌr—r¼r„Úreturncóø—|jdkrtd¦«‚|r|€d}| ¦«}n0|}n-|€d}| ¦«}n| ¦«}t |||||¬¦«}|S)Nrzq must be a scalar or 1dr)rcr¼r˜r?)r¸r·r"Úflattenr;Ú _quantile)rÌr—r¼r?r„r˜r“rs rdr¥r¥Xs—€ð „v�‚z€zõÐ3Ñ4Ô4Ð4Øð Ø ˆ<؈DØ—'’'‘)”)ˆCˆCàˆCˆCà ˆ<؈DØ—)’)‘+”+ˆCˆCà—&’&‘(”(ˆCÝ �sØ!"Ø Ø$Øð  ñ ô €Fð €MrfcóB—tjtj|¦«¦«}tj|dz¦«}||dz k}| ¦«r d||<d||<|dk}| ¦«r d||<d||<tj|jtj¦«r2tj|¦«}| ¦«r d||<d||<| tj ¦«}| tj ¦«}||fS)a Get the valid indexes of arr neighbouring virtual_indexes. Note This is a companion function to linear interpolation of Quantiles Returns ------- (previous_indexes, next_indexes): Tuple A Tuple of virtual_indexes neighbouring indexes rqr¿r) r�r r‘r&r'rÓr/Úisnanr’r)r“r¬Úvalid_values_countr­Ú next_indexesÚindexes_above_boundsÚindexes_below_boundsÚvirtual_indexes_nanss rdÚ _get_indexesrÍys.€õ”}¥R¤X¨oÑ%>Ô%>Ñ?Ô?ÐÝ”=Ð!1°AÑ!5Ñ6Ô6€LØ*Ð.@À1Ñ.DÒDÐà×ÒÑ!Ô!ð0Ø13ÐÐ-Ñ.Ø-/ˆ Ð)Ñ*à*¨QÒ.ÐØ×ÒÑ!Ô!ð/Ø12ÐÐ-Ñ.Ø-.ˆ Ð)Ñ*Ý „}�S”Y¥¤ Ñ+Ô+ð4å!œx¨Ñ8Ô8ÐØ × #Ò #Ñ %Ô %ð 4Ø57Ð Ð1Ñ 2Ø13ˆLÐ-Ñ .Ø'×.Ò.­r¬wÑ7Ô7ÐØ×&Ò&¥r¤wÑ/Ô/€LØ ˜\Ð )Ð)rfr“rcc óà—tj|¦«}|j|}|dkrtj||d¬¦«} t|}n:#t $r-t |›dt ¦«›�¦«d‚wxYw|d||¦«}tj|¦«}tj|j tj ¦«p |j j dv}tj|j tj ¦«r®|rT|  t| ¦«dgf¦«d¬¦«tj|d ¦«}nD|  | ¦«d¬¦«tjd t$¬ ¦«}t'||d|¬ ¦«} nõt)|||¦«\} } |  tjtjddg|  ¦«|  ¦«f¦«¦«d¬¦«|rtj|d ¦«}nd}|| } || } t-|| |¦«}|jd |jdz zz}| |¦«}t3| | ||¬¦«} tj|¦«r3| jdkr |€ |d} ntj| |d |¬¦«| S)a  Private function that doesn't support extended axis or keepdims. These methods are extended to this function using _ureduce See nanpercentile for parameter usage It computes the quantiles of the array for the given axis. A linear interpolation is performed based on the `interpolation`. By default, the method is "linear" where alpha == beta == 1 which performs the 7th method of Hyndman&Fan. With "median_unbiased" we get alpha == beta == 1/3 thus the 8th method of Hyndman&Fan. r)Ú destinationz$ is not a valid method. Use one of: Nrmr‰r¿ró)r¿.FrÔrŠrÒrqrLr )r�r rvÚmoveaxisÚ_QuantileMethodsÚKeyErrorr·Úkeysr'rÓr/rhrr$r r"rÇr rörrÍÚuniquer®r¸r;r²r&r)r“rcr¼r˜r?Ú values_countr¬r‘Úslices_having_nansrr­rÉr¸r¹rjrs rdrÅrÅœs"€õ( Œ-˜Ñ Ô €CØ”9˜T”?€Lð ˆq‚y€yÝŒk˜#˜t°Ð3Ñ3Ô3ˆð 4Ý! &Ô)ˆˆøÝ ð4ð4ð4ÝØð )ð )Ý×$Ò$Ñ&Ô&ð )ð )ñ*ô*à/3ð 4ð4øøøð2�fÐ0Ô1°,À ÑJÔJ€OÝ”m OÑ4Ô4€Oõ ŒM˜#œ)¥R¤ZÑ 0Ô 0Ð J°C´I´NÀdÐ4Jðõ „}�_Ô*­B¬JÑ7Ô7ð$ à ð =à �MŠM�+ ×'<Ò'<Ñ'>Ô'>ÀÀÐ&EÑFÔFÈQˆMÑ OÔ OÐ OÝ!#¤¨#¨g¬,Ñ!7Ô!7Ð Ð ð �MŠM˜/×/Ò/Ñ1Ô1¸ˆMÑ :Ô :Ð :Ý!#¤¨%µtÐ!<Ñ!<Ô!<Ð Ý�c˜?°¸Ð<Ñ<Ô<ˆˆå)5°cØ6EØ6Bñ*Dô*DÑ&И,ð � Š Ý ŒI•b”n q¨" gØ&6×&<Ò&<Ñ&>Ô&>Ø&2×&8Ò&8Ñ&:Ô&:ð&(ñ)ô)ñ *ô *ðð ñ ô ð ð ð &Ý!#¤¨#¨g¬,Ñ!7Ô!7Ð Ð à!%Ð àÐ'Ô(ˆØ�<Ô ˆå˜?Ð,<¸fÑEÔEˆØ&Ô,¨t°s´xÀ!±|Ñ/DÑDˆ Ø— ’ ˜lÑ+Ô+ˆÝ�xØØØð ñ ô ˆõ „vÐ Ñ!Ô!ðFØ Œ;˜!Ò Ð    à˜”WˆFˆFå ŒI�f˜c 'œlÐ2DÐ EÑ EÔ EÐ EØ €Ms Á AÁ7Bcó —||fSr_rh©rÉrìr5r¼s rdÚ_trapz_dispatcherrÙõs €Ø ˆqˆ6€Mrfrsc ó.—t|¦«}|€|}nkt|¦«}|jdkr@t|¦«}dg|jz}|jd||<| |¦«}nt||¬¦«}|j}t d¦«g|z}t d¦«g|z}t dd¦«||<t dd¦«||< ||t |¦«|t |¦«zzdz  |¦«} n|#t$rotj |¦«}tj |¦«}tj ||t |¦«|t |¦«zzdz |¦«} YnwxYw| S)aè Integrate along the given axis using the composite trapezoidal rule. If `x` is provided, the integration happens in sequence along its elements - they are not sorted. Integrate `y` (`x`) along each 1d slice on the given axis, compute :math:`\int y(x) dx`. When `x` is specified, this integrates along the parametric curve, computing :math:`\int_t y(t) dt = \int_t y(t) \left.\frac{dx}{dt}\right|_{x=x(t)} dt`. Parameters ---------- y : array_like Input array to integrate. x : array_like, optional The sample points corresponding to the `y` values. If `x` is None, the sample points are assumed to be evenly spaced `dx` apart. The default is None. dx : scalar, optional The spacing between sample points when `x` is None. The default is 1. axis : int, optional The axis along which to integrate. Returns ------- trapz : float or ndarray Definite integral of `y` = n-dimensional array as approximated along a single axis by the trapezoidal rule. If `y` is a 1-dimensional array, then the result is a float. If `n` is greater than 1, then the result is an `n`-1 dimensional array. See Also -------- sum, cumsum Notes ----- Image [2]_ illustrates trapezoidal rule -- y-axis locations of points will be taken from `y` array, by default x-axis distances between points will be 1.0, alternatively they can be provided with `x` array or with `dx` scalar. Return value will be equal to combined area under the red lines. References ---------- .. [1] Wikipedia page: https://en.wikipedia.org/wiki/Trapezoidal_rule .. [2] Illustration image: https://en.wikipedia.org/wiki/File:Composite_trapezoidal_rule_illustration.png Examples -------- Use the trapezoidal rule on evenly spaced points: >>> np.trapz([1, 2, 3]) 4.0 The spacing between sample points can be selected by either the ``x`` or ``dx`` arguments: >>> np.trapz([1, 2, 3], x=[4, 6, 8]) 8.0 >>> np.trapz([1, 2, 3], dx=2) 8.0 Using a decreasing ``x`` corresponds to integrating in reverse: >>> np.trapz([1, 2, 3], x=[8, 6, 4]) -8.0 More generally ``x`` is used to integrate along a parametric curve. We can estimate the integral :math:`\int_0^1 x^2 = 1/3` using: >>> x = np.linspace(0, 1, num=50) >>> y = x**2 >>> np.trapz(y, x) 0.33340274885464394 Or estimate the area of a circle, noting we repeat the sample which closes the curve: >>> theta = np.linspace(0, 2 * np.pi, num=1000, endpoint=True) >>> np.trapz(np.cos(theta), x=np.sin(theta)) 3.141571941375841 ``np.trapz`` can be applied along a specified axis to do multiple computations in one call: >>> a = np.arange(6).reshape(2, 3) >>> a array([[0, 1, 2], [3, 4, 5]]) >>> np.trapz(a, axis=0) array([1.5, 2.5, 3.5]) >>> np.trapz(a, axis=1) array([2., 8.]) Nrqrrór¿r$) r r¸r>rvr;r)rµr'r·r�r rÚreduce) rÉrìr5r¼rOrvrLr9r:Úrets rdrVrVùs…€õL �1‰ Œ €AØ€yØ ˆˆå �q‰MŒMˆØ Œ6�QŠ;ˆ;Ý�Q‘”ˆAà�C˜œ‘JˆEØœ' !œ*ˆE�$‰KØ— ’ ˜%Ñ Ô ˆAˆAå�Q˜TÐ"Ñ"Ô"ˆAØ Œ€BÝ�D‰kŒkˆ]˜2Ñ €FÝ�D‰kŒkˆ]˜2Ñ €Fݘ˜D‘>”>€Fˆ4�Lݘ˜r‘?”?€Fˆ4�LðLØ�A•e˜F‘m”mÔ$ q­¨v©¬Ô'7Ñ7Ñ8¸3Ñ>×CÒCÀDÑIÔIˆˆøÝ ðLðLðLå ŒJ�q‰MŒMˆÝ ŒJ�q‰MŒMˆÝŒj˜˜a¥ f¡ ¤ Ô.¨qµ°v±´Ô/?Ñ?Ñ@ÀÑDÀdÑKÔKˆˆˆð Løøøð €JsÃADÄA6FÆFÚ__code__có(—t||||¬¦«S)N)rìr5r¼)rVrØs rdÚ _fake_trapzrß‚s€Ý ��a˜B TÐ *Ñ *Ô *Ð*rf)r;ÚsparseÚindexingcó—|Sr_rh)r;ràráÚxis rdÚ_meshgrid_dispatcherrä�s€Ø €IrfÚxycóF‡—t|¦«}|dvrtd¦«‚d|zŠˆfd„t|¦«D¦«}|dkr6|dkr0d‰dd …z|d _d ‰dd …z|d_|st j|d d iŽ}|r d„|D¦«}|S)aÑ Return a list of coordinate matrices from coordinate vectors. Make N-D coordinate arrays for vectorized evaluations of N-D scalar/vector fields over N-D grids, given one-dimensional coordinate arrays x1, x2,..., xn. .. versionchanged:: 1.9 1-D and 0-D cases are allowed. Parameters ---------- x1, x2,..., xn : array_like 1-D arrays representing the coordinates of a grid. indexing : {'xy', 'ij'}, optional Cartesian ('xy', default) or matrix ('ij') indexing of output. See Notes for more details. .. versionadded:: 1.7.0 sparse : bool, optional If True the shape of the returned coordinate array for dimension *i* is reduced from ``(N1, ..., Ni, ... Nn)`` to ``(1, ..., 1, Ni, 1, ..., 1)``. These sparse coordinate grids are intended to be use with :ref:`basics.broadcasting`. When all coordinates are used in an expression, broadcasting still leads to a fully-dimensonal result array. Default is False. .. versionadded:: 1.7.0 copy : bool, optional If False, a view into the original arrays are returned in order to conserve memory. Default is True. Please note that ``sparse=False, copy=False`` will likely return non-contiguous arrays. Furthermore, more than one element of a broadcast array may refer to a single memory location. If you need to write to the arrays, make copies first. .. versionadded:: 1.7.0 Returns ------- X1, X2,..., XN : list of ndarrays For vectors `x1`, `x2`,..., `xn` with lengths ``Ni=len(xi)``, returns ``(N1, N2, N3,..., Nn)`` shaped arrays if indexing='ij' or ``(N2, N1, N3,..., Nn)`` shaped arrays if indexing='xy' with the elements of `xi` repeated to fill the matrix along the first dimension for `x1`, the second for `x2` and so on. Notes ----- This function supports both indexing conventions through the indexing keyword argument. Giving the string 'ij' returns a meshgrid with matrix indexing, while 'xy' returns a meshgrid with Cartesian indexing. In the 2-D case with inputs of length M and N, the outputs are of shape (N, M) for 'xy' indexing and (M, N) for 'ij' indexing. In the 3-D case with inputs of length M, N and P, outputs are of shape (N, M, P) for 'xy' indexing and (M, N, P) for 'ij' indexing. The difference is illustrated by the following code snippet:: xv, yv = np.meshgrid(x, y, indexing='ij') for i in range(nx): for j in range(ny): # treat xv[i,j], yv[i,j] xv, yv = np.meshgrid(x, y, indexing='xy') for i in range(nx): for j in range(ny): # treat xv[j,i], yv[j,i] In the 1-D and 0-D case, the indexing and sparse keywords have no effect. See Also -------- mgrid : Construct a multi-dimensional "meshgrid" using indexing notation. ogrid : Construct an open multi-dimensional "meshgrid" using indexing notation. how-to-index Examples -------- >>> nx, ny = (3, 2) >>> x = np.linspace(0, 1, nx) >>> y = np.linspace(0, 1, ny) >>> xv, yv = np.meshgrid(x, y) >>> xv array([[0. , 0.5, 1. ], [0. , 0.5, 1. ]]) >>> yv array([[0., 0., 0.], [1., 1., 1.]]) The result of `meshgrid` is a coordinate grid: >>> import matplotlib.pyplot as plt >>> plt.plot(xv, yv, marker='o', color='k', linestyle='none') >>> plt.show() You can create sparse output arrays to save memory and computation time. >>> xv, yv = np.meshgrid(x, y, sparse=True) >>> xv array([[0. , 0.5, 1. ]]) >>> yv array([[0.], [1.]]) `meshgrid` is very useful to evaluate functions on a grid. If the function depends on all coordinates, both dense and sparse outputs can be used. >>> x = np.linspace(-5, 5, 101) >>> y = np.linspace(-5, 5, 101) >>> # full coordinate arrays >>> xx, yy = np.meshgrid(x, y) >>> zz = np.sqrt(xx**2 + yy**2) >>> xx.shape, yy.shape, zz.shape ((101, 101), (101, 101), (101, 101)) >>> # sparse coordinate arrays >>> xs, ys = np.meshgrid(x, y, sparse=True) >>> zs = np.sqrt(xs**2 + ys**2) >>> xs.shape, ys.shape, zs.shape ((1, 101), (101, 1), (101, 101)) >>> np.array_equal(zz, zs) True >>> h = plt.contourf(x, y, zs) >>> plt.axis('scaled') >>> plt.colorbar() >>> plt.show() )råÚijz.Valid values for `indexing` are 'xy' and 'ij'.rÒcó–•—g|]E\}}tj|¦« ‰d|…dz‰|dzd…z¦«‘ŒFS)Nrurq)r�r r;)rrrìÚs0s €rdrzmeshgrid..sbø€ð)ð)ð)Ù�!�QõŒm˜AÑÔ×&Ò& r¨"¨1¨"¤v°¡~¸¸1¸q¹5¸6¸6¼ Ñ'BÑCÔCð)ð)ð)rfrårq)rqr¿rNr)r¿rqrTcó6—g|]}| ¦«‘ŒSrhr~rÚs rdrzmeshgrid..+s €Ð+Ð+Ð+˜q�!—&’&‘(”(Ð+Ð+Ð+rf)r¶r·r rvr�r )r;ràrárãr¸r+rés @rdrXrX’sìø€õJ ˆr‰7Œ7€Dà�|Ð#Ð#ÝØ <ñ>ô>ð >ð �‰€Bð)ð)ð)ð)Ý# B™-œ-ð)ñ)ô)€Fð�4ÒИD 1šH˜Hà! B q r r¤FÑ*ˆˆqŒ ŒØ! B q r r¤FÑ*ˆˆqŒ Œà ð:åÔ$ fÐ9°DÐ9Ð9ˆà ð,Ø+Ð+ FÐ+Ñ+Ô+ˆà €Mrfcó —||fSr_rh)r“Úobjr¼s rdÚ_delete_dispatcherrí0s €Ø �ˆ:Ðrfcó@ —d}t|¦«tur |j}n#t$rYnwxYwt |¦«}|j}|jjrdnd}|€'|dkr| ¦«}|j}|dz }nt||¦«}td¦«g|z}|j |}t|j ¦«}t|t¦«�r| |¦«\} } } t| | | ¦«} t!| ¦«} | dkr7|r|| |¬¦«¦«S| |¬¦«S| dkr| } | d} | ddz} ||xx| zcc<t%||j|¦«}| dkrn8td| ¦«||<|t)|¦«|t)|¦«<| |krnat| | z d¦«||<td¦«g|z}t| d¦«||<|t)|¦«|t)|¦«<| dkrnŸt+| | z t,¬¦«}d |d| | z | …<t| | | z ¦«||<td¦«g|z}t| | ¦«||<|t)|¦«}|||<|t)|¦«|t)|¦«<|r ||¦«S|St|t.t0f¦«rt|t,¦«sd }n‡d }|}t3j|¦«}|jdkr5t|t2j¦«s| t8¦«}n/|jdkr$|jjd vr| ¦«}d }|rí|| ks||krt?d |||fz¦«‚|dkr||z }||xxdzcc<t%||j|¦«}td|¦«||<|t)|¦«|t)|¦«<t|d¦«||<td¦«g|z}t|dzd¦«||<|t)|¦«|t)|¦«<nx|jt,kr2|j |fkr"tAd  !|¦«¦«‚|}nt+|t,¬¦«}d ||f<|||<|t)|¦«}|r ||¦«S|S)a Return a new array with sub-arrays along an axis deleted. For a one dimensional array, this returns those entries not returned by `arr[obj]`. Parameters ---------- arr : array_like Input array. obj : slice, int or array of ints Indicate indices of sub-arrays to remove along the specified axis. .. versionchanged:: 1.19.0 Boolean indices are now treated as a mask of elements to remove, rather than being cast to the integers 0 and 1. axis : int, optional The axis along which to delete the subarray defined by `obj`. If `axis` is None, `obj` is applied to the flattened array. Returns ------- out : ndarray A copy of `arr` with the elements specified by `obj` removed. Note that `delete` does not occur in-place. If `axis` is None, `out` is a flattened array. See Also -------- insert : Insert elements into an array. append : Append elements at the end of an array. Notes ----- Often it is preferable to use a boolean mask. For example: >>> arr = np.arange(12) + 1 >>> mask = np.ones(len(arr), dtype=bool) >>> mask[[0,2,4]] = False >>> result = arr[mask,...] Is equivalent to ``np.delete(arr, [0,2,4], axis=0)``, but allows further use of `mask`. Examples -------- >>> arr = np.array([[1,2,3,4], [5,6,7,8], [9,10,11,12]]) >>> arr array([[ 1, 2, 3, 4], [ 5, 6, 7, 8], [ 9, 10, 11, 12]]) >>> np.delete(arr, 1, 0) array([[ 1, 2, 3, 4], [ 9, 10, 11, 12]]) >>> np.delete(arr, np.s_[::2], 1) array([[ 2, 4], [ 6, 8], [10, 12]]) >>> np.delete(arr, [1,3,5], None) array([ 1, 3, 5, 7, 8, 9, 10, 11, 12]) Nr€ÚCrqr)rær¿rÔFTÚuiz2index %i is out of bounds for axis %i with size %iz\boolean array argument obj to delete must be one dimensional and match the axis length of {})"rÖrÚ__array_wrap__ÚAttributeErrorr r¸ÚflagsÚfncr"r/r)rvrõrôÚindicesr&r¶r;r rÓrµrrör1rr�r×r’rrhr‹Ú IndexErrorr·r¹)r“rìr¼Úwrapr¸ÚarrorderÚslobjr3ÚnewshapeÚstartÚstopÚstepÚxrÚnumtodelÚnewÚslobj2r|Ú single_valueÚ_objs rdrYrY4sO€ðB €DÝ ˆC�y„y�ÐÐð ØÔ%ˆDˆDøÝð ð ð Ø ˆDð øøøõ �#‰,Œ,€CØ Œ8€DØ”i”mÐ,ˆsˆs¨€HØ €|Ø �1Š9ˆ9Ø—)’)‘+”+ˆCàŒxˆØ�a‰xˆˆå# D¨$Ñ/Ô/ˆå �4‰[Œ[ˆM˜$Ñ €EØ Œ �$Œ€AÝ�C”I‰Œ€Hå�#•uÑÔñ0ØŸKšK¨™NœNшˆt�TÝ �5˜$ Ñ %Ô %ˆÝ�r‘7”7ˆà �qŠ=ˆ=Øð 0Ø�t˜CŸHšH¨8˜HÑ4Ô4Ñ5Ô5Ð5à—x’x h�xÑ/Ô/Ð/ð �!Š8ˆ8Ø�5ˆDØ�r”FˆEØ�a”5˜1‘9ˆDà�ˆˆŒ˜(Ñ"ˆˆ‰Ý�H˜cœi¨Ñ2Ô2ˆà �AŠ:ˆ:Ø å  eÑ,Ô,ˆE�$‰KØ #¥E¨%¡L¤LÔ 1ˆC•�e‘ ” Ñ à �1Š9ˆ9Ø å  X¡ ¨tÑ4Ô4ˆE�$‰KݘD‘k”k�] 4Ñ'ˆFÝ   tÑ,Ô,ˆF�4‰LØ #¥E¨&¡M¤MÔ 2ˆC•�e‘ ” Ñ à �1Š9ˆ9Ø å˜˜U™ ­$Ð/Ñ/Ô/ˆDØ%*ˆDÐ!�$�u‘*˜TÐ!Ñ "Ý  t¨H¡}Ñ5Ô5ˆE�$‰KݘD‘k”k�] 4Ñ'ˆFÝ  ¨Ñ-Ô-ˆF�4‰LØ•e˜F‘m”mÔ$ˆC؈F�4‰LØ #¥E¨&¡M¤MÔ 2ˆC•�e‘ ” Ñ Ø ð Ø�4˜‘9”9Ð àˆJå�#��W�~Ñ&Ô&ð ­z¸#½tÑ/DÔ/Dð Øˆ ˆ àˆ ØˆÝŒj˜‰oŒoˆð Œ8�qŠ=ˆ=¥¨Dµ"´*Ñ!=Ô!=ˆ=Ø—*’*�TÑ"Ô"ˆCˆCØ ŒX˜Š]ˆ]˜sœyœ~°Ð5Ð5ð—(’(‘*”*ˆC؈Làð à �1�"ŠHˆH˜˜qš˜ÝðØ  $¨˜Nñ+ñ,ô,ð ,ð �!ŠGˆGØ �1‰HˆCØ�ˆˆŒ˜!шˆ‰Ý�H˜cœi¨Ñ2Ô2ˆÝ˜D #Ñ&Ô&ˆˆd‰ Ø¥ e¡ ¤ Ô-ˆ�E�%‰LŒLÑݘC Ñ&Ô&ˆˆd‰ ݘ‘+”+�˜tÑ#ˆÝ˜S ™U DÑ)Ô)ˆˆt‰ Ø¥ f¡ ¤ Ô.ˆ�E�%‰LŒLÑÐà Œ9�Ò Ð ØŒy˜Q˜DÒ Ð Ý ð"0ç06²°q± ´ ñ;ô;ð;ð �4ˆDˆD嘥Ð&Ñ&Ô&ˆD؈D��‰Jàˆˆd‰ Ø•%˜‘,”,Ôˆà ð؈t�C‰yŒyÐàˆ ó š"¢ /®/có —|||fSr_rh)r“rìrUr¼s rdÚ_insert_dispatcherrôs€Ø ��fÐ Ðrfcól—d}t|¦«tur |j}n#t$rYnwxYwt |¦«}|j}|jjrdnd}|€'|dkr| ¦«}|j}|dz }nt||¦«}td¦«g|z}|j |}t|j ¦«} t|t¦«r%t| |¦«dt iŽ} nut#j|¦«} | jt(kr7t+jdt.d¬¦«|  t ¦«} n| jdkrt3d ¦«‚| jdk�r…|  ¦«} | | ks| |krt9d |›d |›d |›�¦«‚| d kr| |z } t%|d|j|j¬¦«}| jd krt#j|d |¦«}|j |} | |xx| z cc<t=| |j|¦«} td| ¦«||<|t?|¦«| t?|¦«<t| | | z¦«||<|| t?|¦«<t| | zd¦«||<td¦«g|z}t| d¦«||<|t?|¦«| t?|¦«<|r || ¦«S| S| jd kr4t|t"j¦«s|  t ¦«} | | d kxx|z cc<tA| ¦«} |  !d¬¦«}| |xxt#j| ¦«z cc<| |xx| z cc<tE| |t(¬¦«}d|| <t=| |j|¦«} td¦«g|z}| ||<|||<|| t?|¦«<|| t?|¦«<|r || ¦«S| S)a Insert values along the given axis before the given indices. Parameters ---------- arr : array_like Input array. obj : int, slice or sequence of ints Object that defines the index or indices before which `values` is inserted. .. versionadded:: 1.8.0 Support for multiple insertions when `obj` is a single scalar or a sequence with one element (similar to calling insert multiple times). values : array_like Values to insert into `arr`. If the type of `values` is different from that of `arr`, `values` is converted to the type of `arr`. `values` should be shaped so that ``arr[...,obj,...] = values`` is legal. axis : int, optional Axis along which to insert `values`. If `axis` is None then `arr` is flattened first. Returns ------- out : ndarray A copy of `arr` with `values` inserted. Note that `insert` does not occur in-place: a new array is returned. If `axis` is None, `out` is a flattened array. See Also -------- append : Append elements at the end of an array. concatenate : Join a sequence of arrays along an existing axis. delete : Delete elements from an array. Notes ----- Note that for higher dimensional inserts ``obj=0`` behaves very different from ``obj=[0]`` just like ``arr[:,0,:] = values`` is different from ``arr[:,[0],:] = values``. Examples -------- >>> a = np.array([[1, 1], [2, 2], [3, 3]]) >>> a array([[1, 1], [2, 2], [3, 3]]) >>> np.insert(a, 1, 5) array([1, 5, 1, ..., 2, 3, 3]) >>> np.insert(a, 1, 5, axis=1) array([[1, 5, 1], [2, 5, 2], [3, 5, 3]]) Difference between sequence and scalars: >>> np.insert(a, [1], [[1],[2],[3]], axis=1) array([[1, 1, 1], [2, 2, 2], [3, 3, 3]]) >>> np.array_equal(np.insert(a, 1, [1, 2, 3], axis=1), ... np.insert(a, [1], [[1],[2],[3]], axis=1)) True >>> b = a.flatten() >>> b array([1, 1, 2, 2, 3, 3]) >>> np.insert(b, [2, 2], [5, 6]) array([1, 1, 5, ..., 2, 3, 3]) >>> np.insert(b, slice(2, 4), [5, 6]) array([1, 1, 5, ..., 2, 3, 3]) >>> np.insert(b, [2, 2], [7.13, False]) # type casting array([1, 1, 7, ..., 2, 3, 3]) >>> x = np.arange(8).reshape(2, 4) >>> idx = (1, 3) >>> np.insert(x, idx, 999, axis=1) array([[ 0, 999, 1, 2, 999, 3], [ 4, 999, 5, 6, 999, 7]]) Nr€rïrqrÓzrin the future insert will treat boolean arrays and array-likes as a boolean index instead of casting it to integerrr8zDindex array argument obj to insert must be one dimensional or scalarzindex z is out of bounds for axis z with size rFr7Ú mergesort)rhrÔ)#rÖrrñròr r¸rórôr"r/r)rvrõrôrrõrr�r rÓrör>r?Ú FutureWarningr’r·r×r‹rörÐr rµr¶r\r)r“rìrUr¼r÷r¸rørùr3rúrõr›ÚnumnewrrræÚold_masks rdrZrZøsn€ðr €DÝ ˆC�y„y�ÐÐð ØÔ%ˆDˆDøÝð ð ð Ø ˆDð øøøõ �#‰,Œ,€CØ Œ8€DØ”i”mÐ,ˆsˆs¨€HØ €|Ø �1Š9ˆ9Ø—)’)‘+”+ˆCàŒxˆØ�a‰xˆˆå# D¨$Ñ/Ô/ˆÝ �4‰[Œ[ˆM˜$Ñ €EØ Œ �$Œ€AÝ�C”I‰Œ€Hå�#•uÑÔðå˜#Ÿ+š+ a™.œ.Ð5µÐ5Ð5ˆˆõ”(˜3‘-”-ˆØ Œ=�DÒ Ð õ ŒMðå(°Qð 8ñ 8ô 8ð 8ð—n’n¥TÑ*Ô*ˆGˆGð Œ\˜AÒ Ð Ýðñôð ð„|�qÒÑØ— ’ ‘”ˆØ �A�2Š:ˆ:˜ š˜Ýð. cð.ð.Àdð.ð.Ø*+ð.ð.ñ/ô/ð /à �AŠIˆIØ �Q‰JˆEõ�v E°´ÀÄÐKÑKÔKˆØ Œ<˜1Ò Ð õ”[ ¨¨DÑ1Ô1ˆFØ”˜dÔ#ˆØ�ˆˆŒ˜&Ñ ˆˆ‰Ý�H˜cœi¨Ñ2Ô2ˆÝ˜D %Ñ(Ô(ˆˆd‰ Ø¥ e¡ ¤ Ô-ˆ�E�%‰LŒLÑݘE 5¨¡<Ñ0Ô0ˆˆd‰ Ø"ˆ�E�%‰LŒLÑݘE &™L¨$Ñ/Ô/ˆˆd‰ ݘ‘+”+� Ñ%ˆÝ˜U DÑ)Ô)ˆˆt‰ Ø¥ f¡ ¤ Ô.ˆ�E�%‰LŒLÑØ ð Ø�4˜‘9”9Р؈ Ø Œ˜Ò Ð ¥:¨cµ2´:Ñ#>Ô#>Ð à—.’.¥Ñ&Ô&ˆà ˆG�aŠKÐÐÔ˜AÑÐÐÑå �‰\Œ\€FØ �OŠO ˆOÑ -Ô -€EØ ˆE€N€N„N•b”i Ñ'Ô'Ñ'€N€N�Nà ˆT€N€N„N�fÑ€N€N�NÝ�H˜T”N­$Ð/Ñ/Ô/€HØ€HˆWÑå �˜#œ) XÑ .Ô .€CÝ�D‰kŒkˆ]˜4Ñ €FØ€Eˆ$�KØ€Fˆ4�LØ€C�ˆe‰ Œ ÑØ€C�ˆf‰ Œ Ñà ð؈t�C‰yŒyÐØ €Jrcó —||fSr_rh©r“rUr¼s rdÚ_append_dispatcherr¶s €Ø �ˆ=Ðrfcóº—t|¦«}|€8|jdkr| ¦«}t|¦«}|jdz }t||f|¬¦«S)a Append values to the end of an array. Parameters ---------- arr : array_like Values are appended to a copy of this array. values : array_like These values are appended to a copy of `arr`. It must be of the correct shape (the same shape as `arr`, excluding `axis`). If `axis` is not specified, `values` can be any shape and will be flattened before use. axis : int, optional The axis along which `values` are appended. If `axis` is not given, both `arr` and `values` are flattened before use. Returns ------- append : ndarray A copy of `arr` with `values` appended to `axis`. Note that `append` does not occur in-place: a new array is allocated and filled. If `axis` is None, `out` is a flattened array. See Also -------- insert : Insert elements into an array. delete : Delete elements from an array. Examples -------- >>> np.append([1, 2, 3], [[4, 5, 6], [7, 8, 9]]) array([1, 2, 3, ..., 7, 8, 9]) When `axis` is specified, `values` must have the correct shape. >>> np.append([[1, 2, 3], [4, 5, 6]], [[7, 8, 9]], axis=0) array([[1, 2, 3], [4, 5, 6], [7, 8, 9]]) >>> np.append([[1, 2, 3], [4, 5, 6]], [7, 8, 9], axis=0) Traceback (most recent call last): ... ValueError: all the input arrays must have same number of dimensions, but the array at index 0 has 2 dimension(s) and the array at index 1 has 1 dimension(s) Nrqró)r r¸r"r r s rdr[r[ºsZ€õb �S‰/Œ/€CØ €|Ø Œ8�qŠ=ˆ=Ø—)’)‘+”+ˆCÝ�v‘”ˆØŒx˜‰zˆÝ ˜˜V�}¨4Ð 0Ñ 0Ô 0Ð0rfcó —||fSr_rh)rìÚbinsrSs rdÚ_digitize_dispatcherrôs €Ø ˆtˆ9Ðrfcó¦—tj|¦«}tj|¦«}tj|jtj¦«rt d¦«‚t|¦«}|dkrtd¦«‚|rdnd}|dkr0t|¦«tj |ddd…||¬¦«z Stj |||¬¦«S) a? Return the indices of the bins to which each value in input array belongs. ========= ============= ============================ `right` order of bins returned index `i` satisfies ========= ============= ============================ ``False`` increasing ``bins[i-1] <= x < bins[i]`` ``True`` increasing ``bins[i-1] < x <= bins[i]`` ``False`` decreasing ``bins[i-1] > x >= bins[i]`` ``True`` decreasing ``bins[i-1] >= x > bins[i]`` ========= ============= ============================ If values in `x` are beyond the bounds of `bins`, 0 or ``len(bins)`` is returned as appropriate. Parameters ---------- x : array_like Input array to be binned. Prior to NumPy 1.10.0, this array had to be 1-dimensional, but can now have any shape. bins : array_like Array of bins. It has to be 1-dimensional and monotonic. right : bool, optional Indicating whether the intervals include the right or the left bin edge. Default behavior is (right==False) indicating that the interval does not include the right edge. The left bin end is open in this case, i.e., bins[i-1] <= x < bins[i] is the default behavior for monotonically increasing bins. Returns ------- indices : ndarray of ints Output array of indices, of same shape as `x`. Raises ------ ValueError If `bins` is not monotonic. TypeError If the type of the input is complex. See Also -------- bincount, histogram, unique, searchsorted Notes ----- If values in `x` are such that they fall outside the bin range, attempting to index `bins` with the indices that `digitize` returns will result in an IndexError. .. versionadded:: 1.10.0 `np.digitize` is implemented in terms of `np.searchsorted`. This means that a binary search is used to bin the values, which scales much better for larger number of bins than the previous linear search. It also removes the requirement for the input array to be 1-dimensional. For monotonically _increasing_ `bins`, the following are equivalent:: np.digitize(x, bins, right=True) np.searchsorted(bins, x, side='left') Note that as the order of the arguments are reversed, the side must be too. The `searchsorted` call is marginally faster, as it does not do any monotonicity checks. Perhaps more importantly, it supports all dtypes. Examples -------- >>> x = np.array([0.2, 6.4, 3.0, 1.6]) >>> bins = np.array([0.0, 1.0, 2.5, 4.0, 10.0]) >>> inds = np.digitize(x, bins) >>> inds array([1, 4, 3, 2]) >>> for n in range(x.size): ... print(bins[inds[n]-1], "<=", x[n], "<", bins[inds[n]]) ... 0.0 <= 0.2 < 1.0 4.0 <= 6.4 < 10.0 2.5 <= 3.0 < 4.0 1.0 <= 1.6 < 2.5 >>> x = np.array([1.2, 10.0, 12.4, 15.5, 20.]) >>> bins = np.array([0, 5, 10, 15, 20]) >>> np.digitize(x,bins,right=True) array([1, 2, 3, 4, 4]) >>> np.digitize(x,bins,right=False) array([1, 3, 3, 4, 5]) zx may not be complexrz3bins must be monotonically increasing or decreasingrRrSr¿N)Úside) rÂr r�r'rÓrfrÈr0r·r¶Ú searchsorted)rìrrSÚmonors rdrKrKøs΀õv Œ �A‰Œ€AÝ Œ;�tÑ Ô €Dõ „}�Q”W�cÔ1Ñ2Ô2ð0ÝÐ.Ñ/Ô/Ð/å ˜Ñ Ô €DØ ˆq‚y€yÝÐNÑOÔOÐOðÐ 'ˆ6ˆ6 €DØ ˆr‚z€zå�4‰yŒy�3Ô+¨D°°°2°¬J¸ÀÐEÑEÔEÑEÐEåÔ  a¨dÐ3Ñ3Ô3Ð3rf)NN)rqr²r_)NNN)NNFr)rF)NNNN)F)Nr¿)rŠ)NT)NNNNNN)NTFNNN)NNFF)NNNNN)NNFr¥F)NNFr¥)r¿r¥N)Nrsr¿)¼Úcollections.abcrøÚ functoolsr§rœr>Ú_utilsrr6r�Únumpy.core.numericÚcoreÚnumericrÂÚ numpy.corerrrrr r r r r rrrrrrrrÚnumpy.core.umathrrrrrrrrrrr r!Únumpy.core.fromnumericr"r#r$r%r&r'Únumpy.core.numerictypesr(r)Únumpy.core.function_baser*Únumpy.lib.twodim_baser+Únumpy.core.multiarrayr,r-r.r/r0r1rZr2rXr3r\rÚnumpy.lib.histogramsr4r5ÚpartialÚarray_function_dispatchÚ__all__ÚdictrÑr°rEr½rDr<rÏrÕrJrIrñr9rr8rr;r r?rIr>rUrcr@rnrAr|rBr‰r:r”rFr™rGrCr©r¹Ú_CORE_DIMENSION_LISTr¬Ú_ARGUMENT_LISTr±r´r»rÅrÊrÓrHr4rLrJrMrTrSrRrQr_rcr]rardrfrWrUrmrPrprNr�r…rOr‡r™r=r¢r]r rŸržr<r€r®r²rzrºr|r`r1rör¥rÍrÅrÙrVrÀrßrÝÚ __globals__Ú __defaults__Ú __closure__Ú__kwdefaults__rärXrírYrrZrr[rrKrhrfrdúr/s–ðØÐÐÐØÐÐÐØ € € € Ø € € € Ø€€€àÐÐÐÐÐØÐÐÐØ Ð Ð Ð Ð Ð Ð Ð Ð Ø Ð Ð Ð Ð Ð ððððððððððððððððððððððððððððððððððððððððððððððððððððððððððððððððððððððððððððððððð.Ð-Ð-Ð-Ð-Ð-Ø Ð Ð Ð Ð Ð Ø/Ð/Ð/Ð/Ð/Ð/Ø&Ð&Ð&Ð&Ð&Ð&ðððððððððððððððððððCÐBÐBÐBÐBÐBà€€€ð8Ð7Ð7Ð7Ð7Ð7Ð7Ð7ð,˜)Ô+Ø Ô%¨gð7ñ7ô7Ðð ð ð €ð6�4ð�ØJÐJØ(Ð(ðñôð˜$ØBÐBðððñôð˜ðOðOà(Ð(ðñôð #˜dð3ð3à(Ð(ðñôð ˆ$ð7ð7à(Ð(ð ñ ô ð ˆDð3ð3à(Ð(ð ñ ô ð ˆ4ØBÐBØ(Ð(ð ñ ô ð�Dð?ð?à(Ð(ðñôð �Dð?ð?à(Ð(ðñôð ˆ$ð1ð1à(Ð(ð ñ ô ð ˆ4ð1ð1à(Ð(ð ñ ô ð ˆTð0ð0ð"ð"ð ñ ô ð ˆDð1ð1à(Ð(ð ñ ô ð[RñRôRÐðjððððÐÐ*Ñ+Ô+ðX6ðX6ðX6ñ,Ô+ðX6ðvððððÐÐ)Ñ*Ô*ðZðZðZñ+Ô*ðZðz €ˆGÑÔð)ð)ñÔð)ðXØ!%ðððððð ÐÐ,Ñ-Ô-ðbØ”[ðbðbðbðbñ.Ô-ðbðJ €ˆGÑÔðC ðC ðC ñÔðC ðLðððÐÐ.Ñ/Ô/ðu ðu ñ0Ô/ðu ðpðððð ÐÐ+Ñ,Ô,ðaðaðañ-Ô,ðaðHððððÐÐ)Ñ*Ô*ðX9ðX9ðX9ñ+Ô*ðX9ðz,0¸Dðððððð ÐÐ-Ñ.Ô.Ø#°ðXðXðXðXñ/Ô.ðXðv  ð ð ð ðÐÐ)Ñ*Ô*Ø�b "¤+°b´kðA ðA ðA ñ+Ô*ðA ðHððððÐÐ+Ñ,Ô,ðI/ðI/ðI/ñ-Ô,ðI/ðXððððÐÐ*Ñ+Ô+ð1 ð1 ð1 ñ,Ô+ð1 ðh¸TððððððÐÐ+Ñ,Ô,ð\¨q°©tð\ð\ð\ð\ñ-Ô,ð\ð~ðððИÑ'Ô'ð!ð!ñ(Ô'ð!ðHððððИÑ%Ô%ð1ð1ð1ñ&Ô%ð1ðhðððÐÐ,Ñ-Ô-ð0>ð0>ñ.Ô-ð0>ðfðððÐÐ*Ñ+Ô+ð$#ð$#ñ,Ô+ð$#ðN' ð' ð' ð' ðV€Ø,×3Ò3°OÑDÔDÐØ × Ò Ð1Ñ 2Ô 2€ Ø!×(Ò(¨Ñ3Ô3€Ø × "Ò " >Ñ 2Ô 2€ ð8ð8ð8ð2"ð"ð"ðD&ð&ð&ð:0ð0ð0ð ð ð ð ð ð  €ˆGÑÔðT4ðT4ðT4ðT4ðT4ñT4ôT4ñÔðT4ðn =AØ,0ð&Ø;?ð&ð&ð&ð&ð&ð ИÑ)Ô)Ø@DØðZØ $ðZðZðZðZñ*Ô)ðZðzØ#ðððððð ÐÐ-Ñ.Ô.ؘt¨"¬+¸B¼KðU ØðU ðU ðU ðU ñ/Ô.ðU ðp €ˆGÑÔðeAðeAñÔðeAðP €ˆGÑÔðm=ðm=ñÔðm=ð` €ˆGÑÔði%ði%ñÔði%ðX €ˆGÑÔðe'ðe'ñÔðe'ðTðð€ðBðð€ð: ð ð ð+ð+ð+ð:ð:ð:ððððИÑ(Ô(ð84ð84ñ)Ô(ð84ðz €ˆGÑÔðD>ðD>ñÔðD>ðNðððÐÐ)Ñ*Ô*ðMðMñ+Ô*ðMð`ðððÐÐ*Ñ+Ô+ð* ð* ñ,Ô+ð* ðZJ ðJ ðJ ðJ ð\@Dððððð ÐÐ+Ñ,Ô,ðR5ðR5ðR5ñ-Ô,ðR5ðj5ð5ð5ð5ðpGKØ15ðØHLðððððð ÐÐ/Ñ0Ô0ðØØ$ØØð c<ð"ðc<ðc<ðc<ðc<ñ1Ô0ðc<ðL EIØ/3ðØFJðððððð ÐÐ-Ñ.Ô.ðØØ"ØØð {<ð ð{<ð{<ð{<ð{<ñ/Ô.ð{<ð@"Ø Ø(-Ø'Ø!&ð #ð#ð#ð#ð$ ð ð ðððð" °ð ¸Uð ð ð ð ð2 ð ð ð,ðððð.ððð ð ð ð;ð;ð;ð ;ð;ð;ðØ Ø %Øð ðØ Œ8ðà Œ8ðððð ð ð„XðððððB *ð *ð *ðLØØ ð VðVØ ŒXðVà”8ðVððVðVðVðVðrððððÐÐ*Ñ+Ô+ð~ð~ð~ñ,Ô+ð~ðL ˆ7�5˜*Ñ %Ô %Ð%Ð%Ð%ð+ð+ð+ð+ðÔ%€„ØÔ+€ÔØ Ô-€ÔØÔ+€ÔØ"Ô1€Ôð$(°¸tðððððð ÐÐ-Ñ.Ô.Ø E°DðZðZðZðZñ/Ô.ðZðzððððÐÐ+Ñ,Ô,ð|ð|ð|ñ-Ô,ð|ð~ððððÐÐ+Ñ,Ô,ðzðzðzñ-Ô,ðzðzððððÐÐ+Ñ,Ô,ð61ð61ð61ñ-Ô,ð61ðrððððÐÐ-Ñ.Ô.ðk4ðk4ðk4ñ/Ô.ðk4ðk4ðk4rf