Did I find the right examples for you? yes no

All Samples(16)  |  Call(10)  |  Derive(0)  |  Import(6)
Repeat a 0-D to 2-D array or matrix MxN times.

Parameters
----------
a : array_like
    The array or matrix to be repeated.
m, n : int
    The number of times `a` is repeated along the first and second axes.

Returns(more...)

        def repmat(a, m, n):
    """
    Repeat a 0-D to 2-D array or matrix MxN times.

    Parameters
    ----------
    a : array_like
        The array or matrix to be repeated.
    m, n : int
        The number of times `a` is repeated along the first and second axes.

    Returns
    -------
    out : ndarray
        The result of repeating `a`.

    Examples
    --------
    >>> import numpy.matlib
    >>> a0 = np.array(1)
    >>> np.matlib.repmat(a0, 2, 3)
    array([[1, 1, 1],
           [1, 1, 1]])

    >>> a1 = np.arange(4)
    >>> np.matlib.repmat(a1, 2, 2)
    array([[0, 1, 2, 3, 0, 1, 2, 3],
           [0, 1, 2, 3, 0, 1, 2, 3]])

    >>> a2 = np.asmatrix(np.arange(6).reshape(2, 3))
    >>> np.matlib.repmat(a2, 2, 3)
    matrix([[0, 1, 2, 0, 1, 2, 0, 1, 2],
            [3, 4, 5, 3, 4, 5, 3, 4, 5],
            [0, 1, 2, 0, 1, 2, 0, 1, 2],
            [3, 4, 5, 3, 4, 5, 3, 4, 5]])

    """
    a = asanyarray(a)
    ndim = a.ndim
    if ndim == 0:
        origrows, origcols = (1, 1)
    elif ndim == 1:
        origrows, origcols = (1, a.shape[0])
    else:
        origrows, origcols = a.shape
    rows = origrows * m
    cols = origcols * n
    c = a.reshape(1, a.size).repeat(m, 0).reshape(rows, origcols).repeat(n, 0)
    return c.reshape(rows, cols)
        


src/g/l/glimpse-0.2.1/glimpse/util/gimage.py   glimpse(Download)
  """
  from numpy import cos, sin, pi, arange, floor, ceil
  from numpy.matlib import repmat
  from scipy.fftpack import ifft2
  dim = np.array(dim, dtype = float)
  u /= dim[0]
  # Reproduce these frequencies along ever row.
  u = repmat(u, 1, dim[1])
  # `v` is the set of frequencies along the second dimension.  For a square
  # region it will be the transpose of `u`.
  v /= dim[1]
  # Reproduce these frequencies along ever column.
  v = repmat(v, dim[0], 1)
  # Generate the power spectrum.
  # This causes intermittent RuntimeWarning: "divide by zero encountered in

src/e/m/empirical-0.2/empirical/basis.py   empirical(Download)
 
import numpy as np
from numpy.matlib import repmat
 
from scipy.special import hankel1  # pylint: disable=E0611
        N = self.N
        M = points.size
        d = (repmat(points.reshape(M, 1), 1, N) -
             repmat(self.q.reshape(1, N), M, 1))
        r = np.abs(d)
            dr = d / r
            if normal_derivative:
                nx = repmat(normals.reshape(M, 1), 1, N)
                nx /= np.abs(nx)
                matrix_n = matrix_1 * (dr.real * nx.real + dr.imag * nx.imag)

src/p/y/pybrain-HEAD/pybrain/rl/learners/modelbased/leastsquares.py   pybrain(Download)
from scipy import ravel, zeros, outer, dot, tile, transpose, tensordot
from scipy.linalg import lstsq
from numpy.matlib import repmat
 
 
        for sto in ss:
            tmp = fMap - discountFactor * repmat(fMap[:, sto], numStates, 1).T
            tmp2 = fMap * repmat(T[:, sto], dim, 1)
            statMatrix += dot(tmp2, tmp.T)             
            statResidual += R[sto] * dot(fMap, T[:, sto])

src/e/m/empirical-0.2/empirical/problem.py   empirical(Download)
 
import numpy as np
from numpy.matlib import repmat
 
from scipy.linalg import (  # pylint: disable=E0611
                                                   normal_derivative=True)
                        Ablock = coeff_a * Ablock + coeff_b * Anblock
                    weights = repmat(self.sqrt_weights[m:mend], 1, b.N)
                    np.multiply(Ablock, weights, A[m:mend, n0:n1])
            m += s.x.size

src/p/y/pybrain-HEAD/pybrain/rl/learners/modelbased/policyiteration.py   pybrain(Download)
 
from scipy import dot, zeros, zeros_like, ones, mean, array, ravel, rand
from numpy.matlib import repmat
 
from pybrain.utilities import all_argmax

src/d/e/deltasigma-0.1-1/deltasigma/_lollipop.py   deltasigma(Download)
import numpy as np
import pylab as plt
from numpy.matlib import repmat
 
# Plot lollipops (o's and sticks)

src/n/u/nupic-linux64-HEAD/lib64/python2.6/site-packages/numpy/tests/test_matlib.py   nupic-linux64(Download)
def test_repmat():
    a1 = np.arange(4)
    x = np.matlib.repmat(a1, 2, 2)
    y = np.array([[0, 1, 2, 3, 0, 1, 2, 3],
                  [0, 1, 2, 3, 0, 1, 2, 3]])

src/m/i/MissionPlanner-HEAD/Lib/site-packages/numpy/tests/test_matlib.py   MissionPlanner(Download)
def test_repmat():
    a1 = np.arange(4)
    x = np.matlib.repmat(a1, 2, 2)
    y = np.array([[0, 1, 2, 3, 0, 1, 2, 3],
                  [0, 1, 2, 3, 0, 1, 2, 3]])

src/n/u/numpy-1.8.1/numpy/tests/test_matlib.py   numpy(Download)
def test_repmat():
    a1 = np.arange(4)
    x = np.matlib.repmat(a1, 2, 2)
    y = np.array([[0, 1, 2, 3, 0, 1, 2, 3],
                  [0, 1, 2, 3, 0, 1, 2, 3]])