Did I find the right examples for you? yes no

All Samples(137)  |  Call(99)  |  Derive(0)  |  Import(38)
Return a matrix of given shape and type, filled with zeros.

Parameters
----------
shape : int or sequence of ints
    Shape of the matrix
dtype : data-type, optional
    The desired data-type for the matrix, default is float.
order : {'C', 'F'}, optional
    Whether to store the result in C- or Fortran-contiguous order,(more...)

        def zeros(shape, dtype=None, order='C'):
    """
    Return a matrix of given shape and type, filled with zeros.

    Parameters
    ----------
    shape : int or sequence of ints
        Shape of the matrix
    dtype : data-type, optional
        The desired data-type for the matrix, default is float.
    order : {'C', 'F'}, optional
        Whether to store the result in C- or Fortran-contiguous order,
        default is 'C'.

    Returns
    -------
    out : matrix
        Zero matrix of given shape, dtype, and order.

    See Also
    --------
    numpy.zeros : Equivalent array function.
    matlib.ones : Return a matrix of ones.

    Notes
    -----
    If `shape` has length one i.e. ``(N,)``, or is a scalar ``N``,
    `out` becomes a single row matrix of shape ``(1,N)``.

    Examples
    --------
    >>> import numpy.matlib
    >>> np.matlib.zeros((2, 3))
    matrix([[ 0.,  0.,  0.],
            [ 0.,  0.,  0.]])

    >>> np.matlib.zeros(2)
    matrix([[ 0.,  0.]])

    """
    a = ndarray.__new__(matrix, shape, dtype, order=order)
    a.fill(0)
    return a
        


src/p/y/pymaclab-0.95.9/pymaclab/dsge/solvers/modsolvers.py   pymaclab(Download)
        # Create all matrices in a loop over argli
        for argx in argli:
            XX = MAT.zeros(argx[3])
            dic1 = dict([[x,'0'] for x in range(argx[3][1])])
            sXX = dict([[x,COP.deepcopy(dic1)] for x in range(len(argx[2]))])
            Xi_mat = \
                   np.concatenate((Gamma_mat,Theta_mat,MAT.eye(m_states),\
                          MAT.zeros((m_states,m_states))),1)
            Delta_mat = \
                  np.concatenate((Psi_mat,MAT.zeros((m_states,m_states)),\
                         MAT.zeros((m_states,m_states)),\
                         MAT.zeros((m_states,m_states)),MAT.eye(m_states),1))

src/d/o/dolo-0.4.6.3/dolo/numeric/extern/helpers.py   dolo(Download)
from numpy import r_, c_, arange, diff, mean, sqrt, log, mat
from numpy import asarray, nan
from numpy.matlib import ones, zeros, rand, eye, empty
from numpy.linalg import eigh, cholesky, solve, lstsq
# (lstsq also as tool to determine rank)
    return u[:, rk:]
 
from numpy.matlib import empty, zeros, eye, mat, asarray
from numpy.linalg import lstsq
def getOrthColumns(m):
    rk = lstsq(m, ones(p).T)[2]
    # first the square and full rank case:
    if rk == p: result = zeros((p,0))   # note the shape! hopefully octave-like
    # then the zero-matrix case (within machine precision):
    elif rk == 0: result = eye(p)
            # (must be ones() instead of 1 because of 2d-requirement
            if lstsq( m[row,:], ones(1) )[2] == 0 or idrcount >= r:
                c = r_[ c, zeros(r) ]
                co = r_[ co, idpr[row-idrcount, :] ]
            else:     # row is non-zero, and we haven't used all unit vecs 
                c = r_[ c, idr[idrcount, :] ] 
                co = r_[ co, zeros(p-r) ]

src/d/o/dolo-HEAD/dolo/numeric/extern/helpers.py   dolo(Download)
from numpy import r_, c_, arange, diff, mean, sqrt, log, mat
from numpy import asarray, nan
from numpy.matlib import ones, zeros, rand, eye, empty
from numpy.linalg import eigh, cholesky, solve, lstsq
# (lstsq also as tool to determine rank)
    return u[:, rk:]
 
from numpy.matlib import empty, zeros, eye, mat, asarray
from numpy.linalg import lstsq
def getOrthColumns(m):
    rk = lstsq(m, ones(p).T)[2]
    # first the square and full rank case:
    if rk == p: result = zeros((p,0))   # note the shape! hopefully octave-like
    # then the zero-matrix case (within machine precision):
    elif rk == 0: result = eye(p)
            # (must be ones() instead of 1 because of 2d-requirement
            if lstsq( m[row,:], ones(1) )[2] == 0 or idrcount >= r:
                c = r_[ c, zeros(r) ]
                co = r_[ co, idpr[row-idrcount, :] ]
            else:     # row is non-zero, and we haven't used all unit vecs 
                c = r_[ c, idr[idrcount, :] ] 
                co = r_[ co, zeros(p-r) ]

src/p/y/pymaclab-0.95.9/pymaclab/dsge/macrolab.py   pymaclab(Download)
 
        # Create P and F matrix reflecting ordering of pymaclab
        P = np.matlib.zeros([self.nstat,self.nstat])
        F = np.matlib.zeros([self.ncon,self.nstat])
        listo = [x[0] for x in self.vdic['exo']]+[x[0] for x in self.vdic['endo']]
            jrows = len(jdic)
            carry_over_dic = {}
            numj = mat.zeros((jrows,jcols))
            alldic = {}
            alldic.update(self.paramdic)
            hcols = len(hdic[0])
            hrows = len(hdic[0])*len(hdic)
            numh = mat.zeros((hrows,hcols))
            jdic = self.jdic
            jdicc = self.jdicc
 
        #Prepare ln inmatrix (vector)
        inmat = mat.zeros((len(tmpli),1))
        alldic={}
        alldic.update(self.paramdic)

src/p/y/pymaclab-0.95.9/pymaclab/dsge/parsers/_dsgeparser.py   pymaclab(Download)
    list_tmp1 = str_tmp1.split(';')
    len1 = len(list_tmp1[0].split())
    mat1=mat.zeros((len1,len1))
    i1=0
    for x in list_tmp1:

src/l/t/LTLMoP-HEAD/src/lib/handlers/share/MotionControl/OMPLControllerHandler.py   LTLMoP(Download)
import sys,os, time
from scipy.linalg import norm
from numpy.matlib import zeros
import scipy as Sci
import scipy.linalg
                    dis_cur  = vstack(((OMPLpath.getSolutionPath().getState(self.currentState)).getX(),(OMPLpath.getSolutionPath().getState(self.currentState)).getY(),(OMPLpath.getSolutionPath().getState(self.currentState)).getZ()))- pose
 
            Vel = zeros([3,1])
            Vel[0:3,0] = dis_cur/norm(dis_cur)*0.3              #TUNE THE SPEED LATER
 
                    self.currentState = self.currentState + 1
                    dis_cur  = vstack(((OMPLpath.getSolutionPath().getState(self.currentState)).getX(),(OMPLpath.getSolutionPath().getState(self.currentState)).getY()))- pose[0:2]
            Vel = zeros([2,1])
            # set different speed for basicSim
            Vel[0:2,0] = dis_cur/norm(dis_cur)*0.5                    #TUNE THE SPEED LATER
                self.currentState = self.currentState + 1
 
        Node = zeros([2,1])
        Node[0,0] = (OMPLpath.getSolutionPath().getState(self.currentState)).getX()
        Node[1,0] = (OMPLpath.getSolutionPath().getState(self.currentState)).getY()

src/l/t/LTLMoP-HEAD/src/lib/handlers/share/MotionControl/RRTControllerHandler.py   LTLMoP(Download)
import sys,os
from scipy.linalg import norm
from numpy.matlib import zeros
import __is_inside
import time, sys,os
            #    dis_cur  = vstack((V[1,E[1,self.E_current_column]],V[2,E[1,self.E_current_column]]))- vstack((V[1,E[0,self.E_current_column]],V[2,E[0,self.E_current_column]]))
 
        Vel = zeros([2,1])
        Vel[0:2,0] = dis_cur/norm(dis_cur)*0.5                    #TUNE THE SPEED LATER
        return Vel
 
 
        Node = zeros([2,1])
        Node[0,0] = V[1,E[1,self.E_current_column]]
        Node[1,0] = V[2,E[1,self.E_current_column]]

src/s/k/Skogestad-Python-HEAD/P_N_M_matrices.py   Skogestad-Python(Download)
dim = np.shape(G(1))[0]  # 1 (non-zero value) used to allow for ramps
I = np.matlib.identity(dim)
Z = np.matlib.zeros((dim, dim))
 
# Store the matrices in suitable indices for later

src/l/t/LTLMoP-HEAD/src/lib/handlers/share/MotionControl/__vectorControllerHelper.py   LTLMoP(Download)
from numpy import *
from scipy.linalg import norm
from numpy.matlib import zeros
from __is_inside import is_inside
 
 
	V = hstack((v, v[:, : 1]))
	d = zeros([v.shape[1], 1])
	for i in range(0, v.shape[1]):
		num = V[1, i+1] - V[1, i]

src/c/o/Code_PyRec-HEAD/wrapper/PCA2/train_database.py   Code_PyRec(Download)
import scipy.linalg
import numpy.matlib
from numpy.matlib import zeros
 
########################################################### all the required modules imported ################################################
# Creating the matrix ( signature matrix )and initialised with zeros 
 
	cv_signature_images=zeros((total_no_of_images,no_of_eigen_vectors_to_be_taken))
	mean_sub_img_array_transpose=numpy.transpose(mean_sub_img_array)  # transpose is taken so it becomes easy for multiplicati
 

  1 | 2 | 3 | 4  Next