Current File : //proc/self/root/proc/self/root/lib64/python2.7/site-packages/numpy/lib/stride_tricks.pyo |
�
E�`Qc @ sM d Z d d l Z d g Z d e f d � � YZ d d d � Z d � Z d S( 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����Nt broadcast_arrayst
DummyArrayc B s e Z d Z d d � Z RS( s� Dummy object that just exists to hang __array_interface__ dictionaries
and possibly keep alive a reference to a base array.
c C s | | _ | | _ d S( N( t __array_interface__t base( t selft interfaceR ( ( s= /usr/lib64/python2.7/site-packages/numpy/lib/stride_tricks.pyt __init__ s N( t __name__t
__module__t __doc__t NoneR ( ( ( s= /usr/lib64/python2.7/site-packages/numpy/lib/stride_tricks.pyR s c C sf t | j � } | d k r. t | � | d <n | d k rM t | � | d <n t j t | d | �� S( sL Make an ndarray from the given array with the given shape and strides.
t shapet stridesR N( t dictR R
t tuplet npt asarrayR ( t xR R R ( ( s= /usr/lib64/python2.7/site-packages/numpy/lib/stride_tricks.pyt
as_strided s c G ss t t j | � } g | D] } | j ^ q } t t | � � d k rJ | Sg | D] } t | � ^ qQ } g | D] } t | j � ^ qp } g | D] } t | � ^ q� } t | � } xi t t | � � D]U } | | | } | d k r� d g | | | | | <d g | | | | | <q� q� Wg } xt | � D]� }
g | D] } | |
^ qB} t | d g � } t | � d k r�t
d |
f � � q5t | � d k r| j d � | j � }
| j
|
� x] t t | � � D]9 } | | |
d k r�|
| | |
<d | | |
<q�q�Wq5| j
d � q5Wg t | | | � D]'