bugged stringlengths 4 228k | fixed stringlengths 0 96.3M | __index_level_0__ int64 0 481k |
|---|---|---|
def __rmul__(self, other): # other * self if isspmatrix(other): ocs = csr_matrix(other) return occ.matmat(self) elif isscalar(other): new = self.copy() new.data = other * new.data new._dtypechar = new.data.dtypechar new.ftype = _transtabl[new._dtypechar] return new else: return transpose(self.rmatvec(transpose(other),... | def __rmul__(self, other): # other * self if isspmatrix(other): ocs = other.tocsc() return occ.matmat(self) elif isscalar(other): new = self.copy() new.data = other * new.data new._dtypechar = new.data.dtypechar new.ftype = _transtabl[new._dtypechar] return new else: return transpose(self.rmatvec(transpose(other),conj... | 1,300 |
def __neg__(self): new = self.copy() new.data = -new.data return new | def __neg__(self): new = self.copy() new.data *= -1 return new | 1,301 |
def __sub__(self, other): ocs = csr_matrix(other) if (ocs.shape != self.shape): raise ValueError, "Inconsistent shapes." dtypechar = _coerce_rules[(self._dtypechar,other._dtypechar)] data1, data2 = _convert_data(self.data, other.data, dtypechar) func = getattr(sparsetools,_transtabl[dtypechar]+'cscadd') c,colc,ptrc,ier... | def __sub__(self, other): if isscalar(other): raise NotImplementedError('subtracting a scalar from a sparse matrix is not yet supported') elif isspmatrix(other): ocs = other.tocsr() if (ocs.shape != self.shape): raise ValueError, "Inconsistent shapes." dtypechar = _coerce_rules[(self._dtypechar, ocs._dtypechar)] data... | 1,302 |
def __sub__(self, other): ocs = csr_matrix(other) if (ocs.shape != self.shape): raise ValueError, "Inconsistent shapes." dtypechar = _coerce_rules[(self._dtypechar,other._dtypechar)] data1, data2 = _convert_data(self.data, other.data, dtypechar) func = getattr(sparsetools,_transtabl[dtypechar]+'cscadd') c,colc,ptrc,ier... | def __sub__(self, other): ocs = csr_matrix(other) if (ocs.shape != self.shape): raise ValueError, "Inconsistent shapes." dtypechar = _coerce_rules[(self._dtypechar,other._dtypechar)] data1, data2 = _convert_data(self.data, other.data, dtypechar) func = getattr(sparsetools,_transtabl[dtypechar]+'cscadd') c,colc,ptrc,ier... | 1,303 |
def __pow__(self, other): """ Element-by-element power (unless other is a scalar, in which case return the matrix power.) """ if isscalar(other): new = self.copy() new.data = new.data ** other new._dtypechar = new.data.dtypechar new.ftype = _transtabl[new._dtypechar] return new else: ocs = csr_matrix(other) if (ocs.sha... | def __pow__(self, other): """ Element-by-element power (unless other is a scalar, in which case return the matrix power.) """ if isscalar(other): new = self.copy() new.data = new.data ** other new._dtypechar = new.data.dtypechar new.ftype = _transtabl[new._dtypechar] return new else: ocs = other.tocsr() if (ocs.shape !... | 1,304 |
def __pow__(self, other): """ Element-by-element power (unless other is a scalar, in which case return the matrix power.) """ if isscalar(other): new = self.copy() new.data = new.data ** other new._dtypechar = new.data.dtypechar new.ftype = _transtabl[new._dtypechar] return new else: ocs = csr_matrix(other) if (ocs.sha... | def __pow__(self, other): """ Element-by-element power (unless other is a scalar, in which case return the matrix power.) """ if isscalar(other): new = self.copy() new.data = new.data ** other new._dtypechar = new.data.dtypechar new.ftype = _transtabl[new._dtypechar] return new else: ocs = csr_matrix(other) if (ocs.sha... | 1,305 |
def __pow__(self, other): """ Element-by-element power (unless other is a scalar, in which case return the matrix power.) """ if isscalar(other): new = self.copy() new.data = new.data ** other new._dtypechar = new.data.dtypechar new.ftype = _transtabl[new._dtypechar] return new else: ocs = csr_matrix(other) if (ocs.sha... | def __pow__(self, other): """ Element-by-element power (unless other is a scalar, in which case return the matrix power.) """ if isscalar(other): new = self.copy() new.data = new.data ** other new._dtypechar = new.data.dtypechar new.ftype = _transtabl[new._dtypechar] return new else: ocs = csr_matrix(other) if (ocs.sha... | 1,306 |
def __add__(self, other): if isinstance(other, dok_matrix): res = dok_matrix() res.update(self) res.shape = self.shape res.nnz = self.nnz for key in other.keys(): res[key] += other[key] else: csc = self.tocsc() res = csc + other return res | def __add__(self, other): if isscalar(other): raise NotImplementedError('adding a scalar to a sparse matrix is not yet supported') elif isinstance(other, dok_matrix): res = dok_matrix() res.update(self) res.shape = self.shape res.nnz = self.nnz for key in other.keys(): res[key] += other[key] else: csc = self.tocsc() ... | 1,307 |
def __sub__(self, other): if isinstance(other, dok_matrix): res = dok_matrix() res.update(self) res.shape = self.shape res.nnz = self.nnz for key in other.keys(): res[key] -= other[key] else: csc = self.tocsc() res = csc - other return res | def __sub__(self, other): if isscalar(other): raise NotImplementedError('subtracting a scalar from a sparse matrix is not yet supported') elif isinstance(other, dok_matrix): res = dok_matrix() res.update(self) res.shape = self.shape res.nnz = self.nnz for key in other.keys(): res[key] -= other[key] else: csc = self.t... | 1,308 |
def __mul__(self, other): if isinstance(other, spmatrix): return self.matmat(other) other = asarray(other) if rank(other) > 0: return self.matvec(other) res = dok_matrix() for key in self.keys(): res[key] = other * self[key] return res | def __mul__(self, other): if isspmatrix(other): return self.matmat(other) other = asarray(other) if rank(other) > 0: return self.matvec(other) res = dok_matrix() for key in self.keys(): res[key] = other * self[key] return res | 1,309 |
def bayes_mvs(data,alpha=0.95): """Return bayesian confidence intervals for the mean, var, and std. Assumes 1-d data all has same mean and variance and uses Jeffrey's prior for variance and std. alpha gives the probability that the returned interval contains the true parameter. """ x = ravel(data) n = len(x) assert(... | def bayes_mvs(data,alpha=0.90): """Return Bayesian confidence intervals for the mean, var, and std. Assumes 1-d data all has same mean and variance and uses Jeffrey's prior for variance and std. alpha gives the probability that the returned interval contains the true parameter. """ x = ravel(data) n = len(x) assert(... | 1,310 |
def bayes_mvs(data,alpha=0.95): """Return bayesian confidence intervals for the mean, var, and std. Assumes 1-d data all has same mean and variance and uses Jeffrey's prior for variance and std. alpha gives the probability that the returned interval contains the true parameter. """ x = ravel(data) n = len(x) assert(... | def bayes_mvs(data,alpha=0.95): """Return bayesian confidence intervals for the mean, var, and std. Assumes 1-d data all has same mean and variance and uses Jeffrey's prior for variance and std. alpha gives the probability that the returned interval contains the true parameter. Uses peak of conditional pdf as starti... | 1,311 |
def bayes_mvs(data,alpha=0.95): """Return bayesian confidence intervals for the mean, var, and std. Assumes 1-d data all has same mean and variance and uses Jeffrey's prior for variance and std. alpha gives the probability that the returned interval contains the true parameter. """ x = ravel(data) n = len(x) assert(... | def bayes_mvs(data,alpha=0.95): """Return bayesian confidence intervals for the mean, var, and std. Assumes 1-d data all has same mean and variance and uses Jeffrey's prior for variance and std. alpha gives the probability that the returned interval contains the true parameter. """ x = ravel(data) n = len(x) assert(... | 1,312 |
def bayes_mvs(data,alpha=0.95): """Return bayesian confidence intervals for the mean, var, and std. Assumes 1-d data all has same mean and variance and uses Jeffrey's prior for variance and std. alpha gives the probability that the returned interval contains the true parameter. """ x = ravel(data) n = len(x) assert(... | def bayes_mvs(data,alpha=0.95): """Return bayesian confidence intervals for the mean, var, and std. Assumes 1-d data all has same mean and variance and uses Jeffrey's prior for variance and std. alpha gives the probability that the returned interval contains the true parameter. """ x = ravel(data) n = len(x) assert(... | 1,313 |
def bayes_mvs(data,alpha=0.95): """Return bayesian confidence intervals for the mean, var, and std. Assumes 1-d data all has same mean and variance and uses Jeffrey's prior for variance and std. alpha gives the probability that the returned interval contains the true parameter. """ x = ravel(data) n = len(x) assert(... | def bayes_mvs(data,alpha=0.95): """Return bayesian confidence intervals for the mean, var, and std. Assumes 1-d data all has same mean and variance and uses Jeffrey's prior for variance and std. alpha gives the probability that the returned interval contains the true parameter. """ x = ravel(data) n = len(x) assert(... | 1,314 |
def binomcdf(k, n, pr=0.5): return special.bdtr(k,n,pr) | def binomcdf(k, n, pr=0.5): sv = errp(0) vals = special.bdtr(k,n,pr) sv = errp(sv) return where(k>=0,vals,0.0) | 1,315 |
def binomsf(k, n, pr=0.5): return special.bdtrc(k,n,pr) | def binomsf(k, n, pr=0.5): sv = errp(0) vals = special.bdtrc(k,n,pr) sv = errp(sv) return where(k>=0,vals,1.0) | 1,316 |
def nbinompdf(k, n, pr=0.5): k = arr(k) cond2 = (pr >= 1) || (pr <=0) cond1 = arr((k > n) & (k == floor(k))) sv =errp(0) temp = special.nbdtr(k,n,pr) temp2 = special.nbdtr(k-1,n,pr) sv = errp(sv) return select([cond2,cond1,k==n], [scipy.nan,temp-temp2,temp],0.0) | def nbinompdf(k, n, pr=0.5): k = arr(k) cond2 = (pr >= 1) | (pr <=0) cond1 = arr((k > n) & (k == floor(k))) sv =errp(0) temp = special.nbdtr(k,n,pr) temp2 = special.nbdtr(k-1,n,pr) sv = errp(sv) return select([cond2,cond1,k==n], [scipy.nan,temp-temp2,temp],0.0) | 1,317 |
def getcolumns(stream, columns, separator): comment = stream.comment lenc = stream.lencomment k, K = 0, len(stream._buffer) while k < K: firstline = stream._buffer[k] if firstline != '' and firstline[:lenc] != comment: break k = k + 1 if k == K: raise ValueError, "No data found in file." firstline = stream._buffer[k] N... | def getcolumns(stream, columns, separator): comment = stream.comment lenc = stream.lencomment k, K = stream.linelist[0], len(stream._buffer) while k < K: firstline = stream._buffer[k] if firstline != '' and firstline[:lenc] != comment: break k = k + 1 if k == K: raise ValueError, "No data found in file." firstline = st... | 1,318 |
def getcolumns(stream, columns, separator): comment = stream.comment lenc = stream.lencomment k, K = 0, len(stream._buffer) while k < K: firstline = stream._buffer[k] if firstline != '' and firstline[:lenc] != comment: break k = k + 1 if k == K: raise ValueError, "No data found in file." firstline = stream._buffer[k] N... | def getcolumns(stream, columns, separator): comment = stream.comment lenc = stream.lencomment k, K = 0, len(stream._buffer) while k < K: firstline = stream._buffer[k] if firstline != '' and firstline[:lenc] != comment: break k = k + 1 if k == K: raise ValueError, "First line to read not within %d lines of top." % K fir... | 1,319 |
def check_rmatvec(self): M = self.spmatrix(matrix([[3,0,0],[0,1,0],[2,0,3.0],[2,3,0]])) assert_array_almost_equal([1,2,3,4]*M, dot([1,2,3,4], M.toarray())) row = matrix([[1,2,3,4]]) # This doesn't work since row*M computes incorrectly when row is 2d. # NumPy needs special hooks for this. # assert_array_almost_equal(row... | def check_rmatvec(self): M = self.spmatrix(matrix([[3,0,0],[0,1,0],[2,0,3.0],[2,3,0]])) assert_array_almost_equal([1,2,3,4]*M, dot([1,2,3,4], M.toarray())) row = matrix([[1,2,3,4]]) # This doesn't work since row*M computes incorrectly when row is 2d. # NumPy needs special hooks for this. # assert_array_almost_equal(row... | 1,320 |
def check_matmat(self): a = matrix([[3,0,0],[0,1,0],[2,0,3.0],[2,3,0]]) a2 = array([[3,0,0],[0,1,0],[2,0,3.0],[2,3,0]]) b = matrix([[0,1],[1,0],[0,2]],'d') asp = self.spmatrix(a) bsp = self.spmatrix(b) assert_array_almost_equal((asp*bsp).todense(), a*b) assert_array_almost_equal((asp*b).todense(), a*b) # The following ... | def check_matmat(self): a = matrix([[3,0,0],[0,1,0],[2,0,3.0],[2,3,0]]) a2 = array([[3,0,0],[0,1,0],[2,0,3.0],[2,3,0]]) b = matrix([[0,1],[1,0],[0,2]],'d') asp = self.spmatrix(a) bsp = self.spmatrix(b) assert_array_almost_equal((asp*bsp).todense(), a*b) assert_array_almost_equal((asp*b).todense(), a*b) # The following ... | 1,321 |
def check_matmat(self): a = matrix([[3,0,0],[0,1,0],[2,0,3.0],[2,3,0]]) a2 = array([[3,0,0],[0,1,0],[2,0,3.0],[2,3,0]]) b = matrix([[0,1],[1,0],[0,2]],'d') asp = self.spmatrix(a) bsp = self.spmatrix(b) assert_array_almost_equal((asp*bsp).todense(), a*b) assert_array_almost_equal((asp*b).todense(), a*b) # The following ... | def check_matmat(self): a = matrix([[3,0,0],[0,1,0],[2,0,3.0],[2,3,0]]) a2 = array([[3,0,0],[0,1,0],[2,0,3.0],[2,3,0]]) b = matrix([[0,1],[1,0],[0,2]],'d') asp = self.spmatrix(a) bsp = self.spmatrix(b) assert_array_almost_equal((asp*bsp).todense(), a*b) assert_array_almost_equal((asp*b).todense(), a*b) # The following ... | 1,322 |
def check_matmat(self): a = matrix([[3,0,0],[0,1,0],[2,0,3.0],[2,3,0]]) a2 = array([[3,0,0],[0,1,0],[2,0,3.0],[2,3,0]]) b = matrix([[0,1],[1,0],[0,2]],'d') asp = self.spmatrix(a) bsp = self.spmatrix(b) assert_array_almost_equal((asp*bsp).todense(), a*b) assert_array_almost_equal((asp*b).todense(), a*b) # The following ... | def check_matmat(self): a = matrix([[3,0,0],[0,1,0],[2,0,3.0],[2,3,0]]) a2 = array([[3,0,0],[0,1,0],[2,0,3.0],[2,3,0]]) b = matrix([[0,1],[1,0],[0,2]],'d') asp = self.spmatrix(a) bsp = self.spmatrix(b) assert_array_almost_equal((asp*bsp).todense(), a*b) assert_array_almost_equal((asp*b).todense(), a*b) # The following ... | 1,323 |
def check_matmat(self): a = matrix([[3,0,0],[0,1,0],[2,0,3.0],[2,3,0]]) a2 = array([[3,0,0],[0,1,0],[2,0,3.0],[2,3,0]]) b = matrix([[0,1],[1,0],[0,2]],'d') asp = self.spmatrix(a) bsp = self.spmatrix(b) assert_array_almost_equal((asp*bsp).todense(), a*b) assert_array_almost_equal((asp*b).todense(), a*b) # The following ... | def check_matmat(self): a = matrix([[3,0,0],[0,1,0],[2,0,3.0],[2,3,0]]) a2 = array([[3,0,0],[0,1,0],[2,0,3.0],[2,3,0]]) b = matrix([[0,1],[1,0],[0,2]],'d') asp = self.spmatrix(a) bsp = self.spmatrix(b) assert_array_almost_equal((asp*bsp).todense(), a*b) assert_array_almost_equal((asp*b).todense(), a*b) # The following ... | 1,324 |
def __call__(self, x, y): z = self.dot(x) + self.dot(y) - 2*self.dot(x, y) return N.exp(-self.gamma*z) | def __call__(self, x, y): z = self.dot(x, x) + self.dot(y, y) - 2*self.dot(x, y) return N.exp(-self.gamma*z) | 1,325 |
def blackman(M): """The M-point Blackman window. """ n = arange(0,M) return 0.42-0.5*cos(2.0*pi*n/(M-1)) + 0.08*cos(4.0*pi*n/(M-1)) | def triang(M,sym=1): """The M-point triangular window. """ if M < 1: return Numeric.array([]) if M == 1: return Numeric.ones(1,'d') odd = M % 2 if not sym and not odd: M = M + 1 n = grid[1:(M+1)/2+1] if M % 2 == 0: w = (2*n-1.0)/M w = r_[w, w[::-1]] else: w = 2*n/(M+1.0) w = r_[w, w[-2::-1]] if not sym and not odd: w ... | 1,326 |
def blackman(M): """The M-point Blackman window. """ n = arange(0,M) return 0.42-0.5*cos(2.0*pi*n/(M-1)) + 0.08*cos(4.0*pi*n/(M-1)) | def blackman(M): """The M-point Blackman window. """ n = arange(0,M) return 0.42-0.5*cos(2.0*pi*n/(M-1)) + 0.08*cos(4.0*pi*n/(M-1)) | 1,327 |
def bartlett(M): """The M-point Bartlett window. """ n = arange(0,M) return where(less_equal(n,(M-1)/2.0),2.0*n/(M-1),2.0-2.0*n/(M-1)) | def bartlett(M): """The M-point Bartlett window. """ n = arange(0,M) return where(less_equal(n,(M-1)/2.0),2.0*n/(M-1),2.0-2.0*n/(M-1)) | 1,328 |
def hanning(M): """The M-point Hanning window. """ n = arange(0,M) return 0.5-0.5*cos(2.0*pi*n/(M-1)) | def hanning(M): """The M-point Hanning window. """ n = arange(0,M) return 0.5-0.5*cos(2.0*pi*n/(M-1)) | 1,329 |
def hamming(M): """The M-point Hamming window. """ n = arange(0,M) return 0.54-0.46*cos(2.0*pi*n/(M-1)) | def hamming(M): """The M-point Hamming window. """ n = arange(0,M) return 0.54-0.46*cos(2.0*pi*n/(M-1)) | 1,330 |
def kaiser(M,beta): """Returns a Kaiser window of length M with shape parameter beta. """ n = arange(0,M) alpha = (M-1)/2.0 return special.i0(beta * sqrt(1-((n-alpha)/alpha)**2.0))/special.i0(beta) | def kaiser(M,beta): """Returns a Kaiser window of length M with shape parameter beta. """ n = arange(0,M) alpha = (M-1)/2.0 return special.i0(beta * sqrt(1-((n-alpha)/alpha)**2.0))/special.i0(beta) | 1,331 |
def gaussian(M,std): """Returns a Gaussian window of length M with standard-deviation std. """ n = arange(0,M)-(M-1.0)/2.0 sig2 = 2*std*std return exp(-n**2 / sig2) | def gaussian(M,std): """Returns a Gaussian window of length M with standard-deviation std. """ n = arange(0,M)-(M-1.0)/2.0 sig2 = 2*std*std return exp(-n**2 / sig2) | 1,332 |
def general_gaussian(M,p,sig): """Returns a window with a generalized Gaussian shape. exp(-0.5*(x/sig)**(2*p)) half power point is at (2*log(2)))**(1/(2*p))*sig """ n = arange(0,M)-(M-1.0)/2.0 return exp(-0.5*(n/sig)**(2*p)) | def general_gaussian(M,p,sig): """Returns a window with a generalized Gaussian shape. exp(-0.5*(x/sig)**(2*p)) half power point is at (2*log(2)))**(1/(2*p))*sig """ n = arange(0,M)-(M-1.0)/2.0 w = exp(-0.5*(n/sig)**(2*p)) if not sym and not odd: w = w[:-1] return w | 1,333 |
def invres(r,p,k,tol=1e-3,rtype='avg'): """Compute b(s) and a(s) from partial fraction expansion: r,p,k If M = len(b) and N = len(a) b(s) b[0] x**(M-1) + b[1] x**(M-2) + ... + b[M-1] H(s) = ------ = ---------------------------------------------- a(s) b[0] x**(M-1) + b[1] x**(M-2) + ... + b[M-1] r[0] r[... | def invres(r,p,k,tol=1e-3,rtype='avg'): """Compute b(s) and a(s) from partial fraction expansion: r,p,k If M = len(b) and N = len(a) b(s) b[0] x**(M-1) + b[1] x**(M-2) + ... + b[M-1] H(s) = ------ = ---------------------------------------------- a(s) a[0] x**(N-1) + a[1] x**(N-2) + ... + a[N-1] r[0] r[... | 1,334 |
def residue(b,a,tol=1e-3,rtype='avg'): """Compute partial-fraction expansion of b(s) / a(s). If M = len(b) and N = len(a) b(s) b[0] x**(M-1) + b[1] x**(M-2) + ... + b[M-1] H(s) = ------ = ---------------------------------------------- a(s) b[0] x**(M-1) + b[1] x**(M-2) + ... + b[M-1] r[0] r[1] ... | def residue(b,a,tol=1e-3,rtype='avg'): """Compute partial-fraction expansion of b(s) / a(s). If M = len(b) and N = len(a) b(s) b[0] s**(M-1) + b[1] s**(M-2) + ... + b[M-1] H(s) = ------ = ---------------------------------------------- a(s) b[0] x**(M-1) + b[1] x**(M-2) + ... + b[M-1] r[0] r[1] ... | 1,335 |
def residue(b,a,tol=1e-3,rtype='avg'): """Compute partial-fraction expansion of b(s) / a(s). If M = len(b) and N = len(a) b(s) b[0] x**(M-1) + b[1] x**(M-2) + ... + b[M-1] H(s) = ------ = ---------------------------------------------- a(s) b[0] x**(M-1) + b[1] x**(M-2) + ... + b[M-1] r[0] r[1] ... | def residue(b,a,tol=1e-3,rtype='avg'): """Compute partial-fraction expansion of b(s) / a(s). If M = len(b) and N = len(a) b(s) b[0] x**(M-1) + b[1] x**(M-2) + ... + b[M-1] H(s) = ------ = ---------------------------------------------- a(s) a[0] s**(N-1) + a[1] s**(N-2) + ... + a[N-1] r[0] r[1] ... | 1,336 |
def residuez(b,a,tol=1e-3): pass | def residuez(b,a,tol=1e-3): pass | 1,337 |
def _get_window(window,Nx): try: beta = float(window) except (TypeError, ValueError): args = () if isinstance(window, types.TupleType): winstr = window[0] if len(window) > 1: args = window[1:] elif isinstance(window, types.StringType): if window in ['kaiser', 'ksr', 'gaussian', 'gauss', 'gss', 'general gaussian', 'gene... | def _get_window(window,Nx): try: beta = float(window) except (TypeError, ValueError): args = () if isinstance(window, types.TupleType): winstr = window[0] if len(window) > 1: args = window[1:] elif isinstance(window, types.StringType): if window in ['kaiser', 'ksr', 'gaussian', 'gauss', 'gss', 'general gaussian', 'gene... | 1,338 |
def _get_window(window,Nx): try: beta = float(window) except (TypeError, ValueError): args = () if isinstance(window, types.TupleType): winstr = window[0] if len(window) > 1: args = window[1:] elif isinstance(window, types.StringType): if window in ['kaiser', 'ksr', 'gaussian', 'gauss', 'gss', 'general gaussian', 'gene... | def _get_window(window,Nx): try: beta = float(window) except (TypeError, ValueError): args = () if isinstance(window, types.TupleType): winstr = window[0] if len(window) > 1: args = window[1:] elif isinstance(window, types.StringType): if window in ['kaiser', 'ksr', 'gaussian', 'gauss', 'gss', 'general gaussian', 'gene... | 1,339 |
def _get_window(window,Nx): try: beta = float(window) except (TypeError, ValueError): args = () if isinstance(window, types.TupleType): winstr = window[0] if len(window) > 1: args = window[1:] elif isinstance(window, types.StringType): if window in ['kaiser', 'ksr', 'gaussian', 'gauss', 'gss', 'general gaussian', 'gene... | def _get_window(window,Nx): try: beta = float(window) except (TypeError, ValueError): args = () if isinstance(window, types.TupleType): winstr = window[0] if len(window) > 1: args = window[1:] elif isinstance(window, types.StringType): if window in ['kaiser', 'ksr', 'gaussian', 'gauss', 'gss', 'general gaussian', 'gene... | 1,340 |
def resample(x,num,axis=0,window=None): """Resample to num samples using Fourier method along the given axis. Window controls a Fourier-domain window that tapers the Fourier spectrum before zero-padding to aleviate ringing in the resampled values for non, band-limited signals. If window is a string then use the named... | def resample(x,num,t=None,axis=0,window=None): """Resample to num samples using Fourier method along the given axis. Window controls a Fourier-domain window that tapers the Fourier spectrum before zero-padding to aleviate ringing in the resampled values for non, band-limited signals. If window is a string then use th... | 1,341 |
def resample(x,num,axis=0,window=None): """Resample to num samples using Fourier method along the given axis. Window controls a Fourier-domain window that tapers the Fourier spectrum before zero-padding to aleviate ringing in the resampled values for non, band-limited signals. If window is a string then use the named... | def resample(x,num,axis=0,window=None): """Resample to num samples using Fourier method along the given axis. Window controls a Fourier-domain window that tapers the Fourier spectrum before zero-padding to aleviate ringing in the resampled values for sampled signals you didn't intend to be interpreted as band-limited.... | 1,342 |
def resample(x,num,axis=0,window=None): """Resample to num samples using Fourier method along the given axis. Window controls a Fourier-domain window that tapers the Fourier spectrum before zero-padding to aleviate ringing in the resampled values for non, band-limited signals. If window is a string then use the named... | def resample(x,num,axis=0,window=None): """Resample to num samples using Fourier method along the given axis. Window controls a Fourier-domain window that tapers the Fourier spectrum before zero-padding to aleviate ringing in the resampled values for non, band-limited signals. If window is a string then use the named... | 1,343 |
def resample(x,num,axis=0,window=None): """Resample to num samples using Fourier method along the given axis. Window controls a Fourier-domain window that tapers the Fourier spectrum before zero-padding to aleviate ringing in the resampled values for non, band-limited signals. If window is a string then use the named... | def resample(x,num,axis=0,window=None): """Resample to num samples using Fourier method along the given axis. Window controls a Fourier-domain window that tapers the Fourier spectrum before zero-padding to aleviate ringing in the resampled values for non, band-limited signals. If window is a string then use the named... | 1,344 |
def resample(x,num,axis=0,window=None): """Resample to num samples using Fourier method along the given axis. Window controls a Fourier-domain window that tapers the Fourier spectrum before zero-padding to aleviate ringing in the resampled values for non, band-limited signals. If window is a string then use the named... | def resample(x,num,axis=0,window=None): """Resample to num samples using Fourier method along the given axis. Window controls a Fourier-domain window that tapers the Fourier spectrum before zero-padding to aleviate ringing in the resampled values for non, band-limited signals. If window is a string then use the named... | 1,345 |
def resample(x,num,axis=0,window=None): """Resample to num samples using Fourier method along the given axis. Window controls a Fourier-domain window that tapers the Fourier spectrum before zero-padding to aleviate ringing in the resampled values for non, band-limited signals. If window is a string then use the named... | def resample(x,num,axis=0,window=None): """Resample to num samples using Fourier method along the given axis. Window controls a Fourier-domain window that tapers the Fourier spectrum before zero-padding to aleviate ringing in the resampled values for non, band-limited signals. If window is a string then use the named... | 1,346 |
def _entropy(self): return 0.64472988584940017414 | def _entropy(self): return 0.64472988584940017414 | 1,347 |
def _entropy(self, b): eB = exp(b) return log(eB-1)+(1+eB*(b-1.0))/(1.0-eB) | def _entropy(self, b): eB = exp(b) return log(eB-1)+(1+eB*(b-1.0))/(1.0-eB) | 1,348 |
def _argcheck(self, a, b): self.a = a self.b = b self.nb = norm_gen._cdf(self,b) self.na = norm_gen._cdf(self,a) return (a != b) | def _argcheck(self, a, b): self.a = a self.b = b self.nb = norm._cdf(b) self.na = norm._cdf(a) return (a != b) | 1,349 |
def _pdf(self, x, a, b): return norm_gen._pdf(self, x) / (self.nb - self.na) | def _pdf(self, x, a, b): return norm_gen._pdf(self, x) / (self.nb - self.na) | 1,350 |
def _cdf(self, x, a, b): return (norm_gen._cdf(self, x) - self.na) / (self.nb - self.na) | def _cdf(self, x, a, b): return (norm_gen._cdf(self, x) - self.na) / (self.nb - self.na) | 1,351 |
def _ppf(self, q, a, b): return norm_gen._ppf(self, q*self.nb + self.na*(1.0-q)) | def _ppf(self, q, a, b): return norm_gen._ppf(self, q*self.nb + self.na*(1.0-q)) | 1,352 |
def _stats(self, a, b): nA, nB = self.na, self.nb d = nB - nA pA, pB = norm_gen._pdf(self, a), norm_gen._pdf(self, b) mu = (pB - pA) / d mu2 = 1 + (a*pA - b*pB) / d - mu*mu return mu, mu2, None, None | def _stats(self, a, b): nA, nB = self.na, self.nb d = nB - nA pA, pB = norm._pdf(a), norm._pdf(b) mu = (pB - pA) / d mu2 = 1 + (a*pA - b*pB) / d - mu*mu return mu, mu2, None, None | 1,353 |
def _stats(self, a, b): nA, nB = self.na, self.nb d = nB - nA pA, pB = norm_gen._pdf(self, a), norm_gen._pdf(self, b) mu = (pB - pA) / d mu2 = 1 + (a*pA - b*pB) / d - mu*mu return mu, mu2, None, None | def _stats(self, a, b): nA, nB = self.na, self.nb d = nB - nA pA, pB = norm_gen._pdf(self, a), norm_gen._pdf(self, b) mu = (pB - pA) / d mu2 = 1 + (a*pA - b*pB) / d - mu*mu return mu, mu2, None, None | 1,354 |
def integ(p): return log(pow(p,lam-1)+pow(1-p,lam-1)) | definteg(p):returnlog(pow(p,lam-1)+pow(1-p,lam-1)) | 1,355 |
def func_and_grad(x): f = func(x, *args) g = fprime(x, *args) return f, g | def func_and_grad(x): f = func(x, *args) g = fprime(x, *args) return f, g | 1,356 |
def func_and_grad(x): f = func(x, *args) g = fprime(x, *args) return f, g | def func_and_grad(x): f = func(x, *args) g = fprime(x, *args) return f, g | 1,357 |
def func_and_grad(x): f = func(x, *args) g = fprime(x, *args) return f, g | def func_and_grad(x): f = func(x, *args) g = fprime(x, *args) return f, g | 1,358 |
def complex(a, b): c = zeros(a.shape, dtype=complex_) c.real = a c.imag = b return c | defv v v v v v v ^ ^ ^ ^ ^ ^ ^ complex(a,v v v v v v v ^ ^ ^ ^ ^ ^ ^ b):v v v v v v v ^ ^ ^ ^ ^ ^ ^ cv v v v v v v ^ ^ ^ ^ ^ ^ ^ =v v v v v v v ^ ^ ^ ^ ^ ^ ^ zeros(a.shape,v v v v v v v ^ ^ ^ ^ ^ ^ ^ dtype=complex_)v v v v v v v ^ ^ ^ ^ ^ ^ ^ c.realv v v v v v v ^ ^ ^ ^ ^ ^ ^ =v v v v v v v ^ ^ ^ ^ ^ ^ ^ av v ... | 1,359 |
def complex(a, b): c = zeros(a.shape, dtype=complex_) c.real = a c.imag = b return c | defv v v v v v v ^ ^ ^ ^ ^ ^ ^ complex(a,v v v v v v v ^ ^ ^ ^ ^ ^ ^ b):v v v v v v v ^ ^ ^ ^ ^ ^ ^ cv v v v v v v ^ ^ ^ ^ ^ ^ ^ =v v v v v v v ^ ^ ^ ^ ^ ^ ^ zeros(a.shape,v v v v v v v ^ ^ ^ ^ ^ ^ ^ dtype=complex_)v v v v v v v ^ ^ ^ ^ ^ ^ ^ c.realv v v v v v v ^ ^ ^ ^ ^ ^ ^ =v v v v v v v ^ ^ ^ ^ ^ ^ ^ av v ... | 1,360 |
def complex(a, b): c = zeros(a.shape, dtype=complex_) c.real = a c.imag = b return c | defv v v v v v v ^ ^ ^ ^ ^ ^ ^ complex(a,v v v v v v v ^ ^ ^ ^ ^ ^ ^ b):v v v v v v v ^ ^ ^ ^ ^ ^ ^ cv v v v v v v ^ ^ ^ ^ ^ ^ ^ =v v v v v v v ^ ^ ^ ^ ^ ^ ^ zeros(a.shape,v v v v v v v ^ ^ ^ ^ ^ ^ ^ dtype=complex_)v v v v v v v ^ ^ ^ ^ ^ ^ ^ c.realv v v v v v v ^ ^ ^ ^ ^ ^ ^ =v v v v v v v ^ ^ ^ ^ ^ ^ ^ av v ... | 1,361 |
def complex(a, b): c = zeros(a.shape, dtype=complex_) c.real = a c.imag = b return c | defv v v v v v v ^ ^ ^ ^ ^ ^ ^ complex(a,v v v v v v v ^ ^ ^ ^ ^ ^ ^ b):v v v v v v v ^ ^ ^ ^ ^ ^ ^ cv v v v v v v ^ ^ ^ ^ ^ ^ ^ =v v v v v v v ^ ^ ^ ^ ^ ^ ^ zeros(a.shape,v v v v v v v ^ ^ ^ ^ ^ ^ ^ dtype=complex_)v v v v v v v ^ ^ ^ ^ ^ ^ ^ c.realv v v v v v v ^ ^ ^ ^ ^ ^ ^ =v v v v v v v ^ ^ ^ ^ ^ ^ ^ av v ... | 1,362 |
def complex(a, b): c = zeros(a.shape, dtype=complex_) c.real = a c.imag = b return c | defv v v v v v v ^ ^ ^ ^ ^ ^ ^ complex(a,v v v v v v v ^ ^ ^ ^ ^ ^ ^ b):v v v v v v v ^ ^ ^ ^ ^ ^ ^ cv v v v v v v ^ ^ ^ ^ ^ ^ ^ =v v v v v v v ^ ^ ^ ^ ^ ^ ^ zeros(a.shape,v v v v v v v ^ ^ ^ ^ ^ ^ ^ dtype=complex_)v v v v v v v ^ ^ ^ ^ ^ ^ ^ c.realv v v v v v v ^ ^ ^ ^ ^ ^ ^ =v v v v v v v ^ ^ ^ ^ ^ ^ ^ av v ... | 1,363 |
def __unmasked(m, get_val, relpos): idx = numpy.where(m.mask == False) if len(idx) != 0 and len(idx[0]) != 0: idx = idx[0][relpos] else: idx = None if get_val: if idx is None: return ma.masked else: return m[idx] else: return idx | def __unmasked(m, get_val, relpos): if m.mask is ma.nomask: return 0 else: idx = None if get_val: if idx is None: return ma.masked else: return m[idx] else: return idx | 1,364 |
def __unmasked(m, get_val, relpos): idx = numpy.where(m.mask == False) if len(idx) != 0 and len(idx[0]) != 0: idx = idx[0][relpos] else: idx = None if get_val: if idx is None: return ma.masked else: return m[idx] else: return idx | def __unmasked(m, get_val, relpos): idx = numpy.where(m.mask == False) if len(idx) != 0 and len(idx[0]) != 0: idx = idx[0][relpos] else: idx = None if get_val: if idx is None: return ma.masked else: return m[idx] else: return idx | 1,365 |
def moment(a, moment=1, axis=0): """Calculates the nth moment about the mean for a sample. Generally used to calculate coefficients of skewness and kurtosis. Parameters ---------- a : array moment : int axis : int or None Returns ------- The appropriate moment along the given axis or over all values if axis is None.... | def moment(a, moment=1, axis=0): """Calculates the nth moment about the mean for a sample. Generally used to calculate coefficients of skewness and kurtosis. Parameters ---------- a : array moment : int axis : int or None Returns ------- The appropriate moment along the given axis or over all values if axis is None.... | 1,366 |
def moment(a, moment=1, axis=0): """Calculates the nth moment about the mean for a sample. Generally used to calculate coefficients of skewness and kurtosis. Parameters ---------- a : array moment : int axis : int or None Returns ------- The appropriate moment along the given axis or over all values if axis is None.... | def moment(a, moment=1, axis=0): """Calculates the nth moment about the mean for a sample. Generally used to calculate coefficients of skewness and kurtosis. Parameters ---------- a : array moment : int axis : int or None Returns ------- The appropriate moment along the given axis or over all values if axis is None.... | 1,367 |
def moment(a, moment=1, axis=0): """Calculates the nth moment about the mean for a sample. Generally used to calculate coefficients of skewness and kurtosis. Parameters ---------- a : array moment : int axis : int or None Returns ------- The appropriate moment along the given axis or over all values if axis is None.... | def moment(a, moment=1, axis=0): """Calculates the nth moment about the mean for a sample. Generally used to calculate coefficients of skewness and kurtosis. Parameters ---------- a : array moment : int axis : int or None Returns ------- The appropriate moment along the given axis or over all values if axis is None.... | 1,368 |
def _import_packages(): """ Import packages in scipy directory that implement info_<packagename>.py. See DEVELOPERS.txt for more info. """ from glob import glob import os frame = sys._getframe(1) for info_file in glob(os.path.join(__path__[0],'*','info_*.py')): package_name = os.path.basename(os.path.dirname(info_fil... | def _import_packages(): """ Import packages in scipy directory that implement info_<packagename>.py. See DEVELOPERS.txt for more info. """ from glob import glob import os frame = sys._getframe(1) for info_file in glob(os.path.join(__path__[0],'*','info_*.py')): package_name = os.path.basename(os.path.dirname(info_fil... | 1,369 |
def cont(self, results, tol=1.0e-05): """ Continue iterating, or has convergence been obtained? """ if self.iter >= GeneralizedLinearModel.niter: return False | def cont(self, results, tol=1.0e-05): """ Continue iterating, or has convergence been obtained? """ if self.iter >= Model.niter: return False | 1,370 |
def __init__(self, method = 'adams', with_jacobian = 0, rtol=1e-6,atol=1e-12, lband=None,uband=None, order = 12, nsteps = 500, max_step = 0.0, # corresponds to infinite min_step = 0.0, first_step = 0.0, # determined by solver ): | def __init__(self, method = 'adams', with_jacobian = 0, rtol=1e-6,atol=1e-12, lband=None,uband=None, order = 12, nsteps = 500, max_step = 0.0, # corresponds to infinite min_step = 0.0, first_step = 0.0, # determined by solver ): | 1,371 |
def calcfc(x, con): f = func(x, *args) k = 0 print "x = ", x print "f = ", f for constraints in cons: con[k] = constraints(x, *consargs) k += 1 print "con = ", con return f | def calcfc(x, con): f = func(x, *args) k = 0 for constraints in cons: con[k] = constraints(x, *consargs) k += 1 print "con = ", con return f | 1,372 |
def calcfc(x, con): f = func(x, *args) k = 0 print "x = ", x print "f = ", f for constraints in cons: con[k] = constraints(x, *consargs) k += 1 print "con = ", con return f | def calcfc(x, con): f = func(x, *args) k = 0 print "x = ", x print "f = ", f for constraints in cons: con[k] = constraints(x, *consargs) k += 1 return f | 1,373 |
def __init__(self, momtype=1, a=None, b=None, xa=-10.0, xb=10.0, xtol=1e-14, badvalue=None, name=None) if badvalue is None: badvalue = nan self.badvalue = badvalue self.name = name self.a = a self.b = b if a is None: self.a = -scipy.inf if b is None: self.b = scipy.inf self.xa = xa self.xb = xb self.xtol = xtol self._s... | def __init__(self, momtype=1, a=None, b=None, xa=-10.0, xb=10.0, xtol=1e-14, badvalue=None, name=None): if badvalue is None: badvalue = nan self.badvalue = badvalue self.name = name self.a = a self.b = b if a is None: self.a = -scipy.inf if b is None: self.b = scipy.inf self.xa = xa self.xb = xb self.xtol = xtol self._... | 1,374 |
def _stats(self): return [scipy.inf]*2 + [scipy.nan]*2 | def _stats(self): return [scipy.inf]*2 + [scipy.nan]*2 | 1,375 |
def _parse_mimatrix(fid,bytes): dclass, cmplx, nzmax =_parse_array_flags(fid) dims = _get_element(fid)[0] name = ''.join(asarray(_get_element(fid)[0]).astype('c')) tupdims = tuple(dims[::-1]) if dclass in mxArrays: result, unused =_get_element(fid) if type == mxCHAR_CLASS: result = ''.join(asarray(result).astype('c')) ... | def _parse_mimatrix(fid,bytes): dclass, cmplx, nzmax =_parse_array_flags(fid) dims = _get_element(fid)[0] name = ''.join(asarray(_get_element(fid)[0]).astype('c')) tupdims = tuple(dims[::-1]) if dclass in mxArrays: result, unused =_get_element(fid) if type == mxCHAR_CLASS: result = ''.join(asarray(result).astype('c')) ... | 1,376 |
def _parse_mimatrix(fid,bytes): dclass, cmplx, nzmax =_parse_array_flags(fid) dims = _get_element(fid)[0] name = ''.join(asarray(_get_element(fid)[0]).astype('c')) tupdims = tuple(dims[::-1]) if dclass in mxArrays: result, unused =_get_element(fid) if type == mxCHAR_CLASS: result = ''.join(asarray(result).astype('c')) ... | def _parse_mimatrix(fid,bytes): dclass, cmplx, nzmax =_parse_array_flags(fid) dims = _get_element(fid)[0] name = ''.join(asarray(_get_element(fid)[0]).astype('c')) tupdims = tuple(dims[::-1]) if dclass in mxArrays: result, unused =_get_element(fid) if type == mxCHAR_CLASS: result = ''.join(asarray(result).astype('c')) ... | 1,377 |
def sum_func(a, axis=-1): axis = encode_axis(axis) if isinstance(a, ConstantNode): return a if isinstance(a, (bool, int, float, complex)): a = ConstantNode(a) kind = a.astKind if kind == 'bool': kind = 'int' return FuncNode('sum', [a, axis], kind=kind) | def sum_func(a, axis=-1): axis = encode_axis(axis) if isinstance(a, ConstantNode): return a if isinstance(a, (bool, int, float, complex)): a = ConstantNode(a) kind = a.astKind if kind == 'bool': kind = 'int' return FuncNode('sum', [a, axis], kind=kind) | 1,378 |
def prod_func(a, axis=-1): axis = encode_axis(axis) if isinstance(a, (bool, int, float, complex)): a = ConstantNode(a) if isinstance(a, ConstantNode): return a kind = a.astKind if kind == 'bool': kind = 'int' return FuncNode('prod', [a, axis], kind=kind) | def prod_func(a, axis=-1): axis = encode_axis(axis) if isinstance(a, (bool, int, float, complex)): a = ConstantNode(a) if isinstance(a, ConstantNode): return a kind = a.astKind if kind == 'bool': kind = 'int' return FuncNode('prod', [a, axis], kind=kind) | 1,379 |
def configuration(parent_package=''): """ gist only works with an X-windows server This will install *.gs and *.gp files to '%spython%s/site-packages/scipy/xplt' % (sys.prefix,sys.version[:3]) """ x11 = x11_info().get_info() if not x11: return config = default_config_dict('xplt',parent_package) local_path = get_path(_... | def configuration(parent_package=''): """ gist only works with an X-windows server This will install *.gs and *.gp files to '%spython%s/site-packages/scipy/xplt' % (sys.prefix,sys.version[:3]) """ x11 = x11_info().get_info() if not x11: return config = default_config_dict('xplt',parent_package) local_path = get_path(_... | 1,380 |
def unique_roots(p,tol=1e-3,rtype='min'): """Determine the unique roots and their multiplicities in two lists Inputs: p -- The list of roots tol --- The tolerance for two roots to be considered equal. rtype --- How to determine the returned root from the close ones: 'max': pick the maximum 'min': pick the minimum 'a... | def unique_roots(p,tol=1e-3,rtype='min'): """Determine the unique roots and their multiplicities in two lists Inputs: p -- The list of roots tol --- The tolerance for two roots to be considered equal. rtype --- How to determine the returned root from the close ones: 'max': pick the maximum 'min': pick the minimum 'a... | 1,381 |
def invres(r,p,k,tol=1e-3): """Compute b(s) and a(s) from partial fraction expansion: r,p,k If M = len(b) and N = len(a) b(s) b[0] x**(M-1) + b[1] x**(M-2) + ... + b[M-1] H(s) = ------ = ---------------------------------------------- a(s) b[0] x**(M-1) + b[1] x**(M-2) + ... + b[M-1] r[0] r[1] ... | def invres(r,p,k,tol=1e-3): """Compute b(s) and a(s) from partial fraction expansion: r,p,k If M = len(b) and N = len(a) b(s) b[0] x**(M-1) + b[1] x**(M-2) + ... + b[M-1] H(s) = ------ = ---------------------------------------------- a(s) b[0] x**(M-1) + b[1] x**(M-2) + ... + b[M-1] r[0] r[1] ... | 1,382 |
def invres(r,p,k,tol=1e-3): """Compute b(s) and a(s) from partial fraction expansion: r,p,k If M = len(b) and N = len(a) b(s) b[0] x**(M-1) + b[1] x**(M-2) + ... + b[M-1] H(s) = ------ = ---------------------------------------------- a(s) b[0] x**(M-1) + b[1] x**(M-2) + ... + b[M-1] r[0] r[1] ... | def invres(r,p,k,tol=1e-3): """Compute b(s) and a(s) from partial fraction expansion: r,p,k If M = len(b) and N = len(a) b(s) b[0] x**(M-1) + b[1] x**(M-2) + ... + b[M-1] H(s) = ------ = ---------------------------------------------- a(s) b[0] x**(M-1) + b[1] x**(M-2) + ... + b[M-1] r[0] r[1] ... | 1,383 |
def invres(r,p,k,tol=1e-3): """Compute b(s) and a(s) from partial fraction expansion: r,p,k If M = len(b) and N = len(a) b(s) b[0] x**(M-1) + b[1] x**(M-2) + ... + b[M-1] H(s) = ------ = ---------------------------------------------- a(s) b[0] x**(M-1) + b[1] x**(M-2) + ... + b[M-1] r[0] r[1] ... | def invres(r,p,k,tol=1e-3): """Compute b(s) and a(s) from partial fraction expansion: r,p,k If M = len(b) and N = len(a) b(s) b[0] x**(M-1) + b[1] x**(M-2) + ... + b[M-1] H(s) = ------ = ---------------------------------------------- a(s) b[0] x**(M-1) + b[1] x**(M-2) + ... + b[M-1] r[0] r[1] ... | 1,384 |
def residue(b,a,tol=1e-3): """Compute partial-fraction expansion of b(s) / a(s). If M = len(b) and N = len(a) b(s) b[0] x**(M-1) + b[1] x**(M-2) + ... + b[M-1] H(s) = ------ = ---------------------------------------------- a(s) b[0] x**(M-1) + b[1] x**(M-2) + ... + b[M-1] r[0] r[1] r[-1] = ... | def residue(b,a,tol=1e-3,rtype='avg'): """Compute partial-fraction expansion of b(s) / a(s). If M = len(b) and N = len(a) b(s) b[0] x**(M-1) + b[1] x**(M-2) + ... + b[M-1] H(s) = ------ = ---------------------------------------------- a(s) b[0] x**(M-1) + b[1] x**(M-2) + ... + b[M-1] r[0] r[1] ... | 1,385 |
def residue(b,a,tol=1e-3): """Compute partial-fraction expansion of b(s) / a(s). If M = len(b) and N = len(a) b(s) b[0] x**(M-1) + b[1] x**(M-2) + ... + b[M-1] H(s) = ------ = ---------------------------------------------- a(s) b[0] x**(M-1) + b[1] x**(M-2) + ... + b[M-1] r[0] r[1] r[-1] = ... | def residue(b,a,tol=1e-3): """Compute partial-fraction expansion of b(s) / a(s). If M = len(b) and N = len(a) b(s) b[0] x**(M-1) + b[1] x**(M-2) + ... + b[M-1] H(s) = ------ = ---------------------------------------------- a(s) b[0] x**(M-1) + b[1] x**(M-2) + ... + b[M-1] r[0] r[1] r[-1] = ... | 1,386 |
def residue(b,a,tol=1e-3): """Compute partial-fraction expansion of b(s) / a(s). If M = len(b) and N = len(a) b(s) b[0] x**(M-1) + b[1] x**(M-2) + ... + b[M-1] H(s) = ------ = ---------------------------------------------- a(s) b[0] x**(M-1) + b[1] x**(M-2) + ... + b[M-1] r[0] r[1] r[-1] = ... | def residue(b,a,tol=1e-3): """Compute partial-fraction expansion of b(s) / a(s). If M = len(b) and N = len(a) b(s) b[0] x**(M-1) + b[1] x**(M-2) + ... + b[M-1] H(s) = ------ = ---------------------------------------------- a(s) b[0] x**(M-1) + b[1] x**(M-2) + ... + b[M-1] r[0] r[1] r[-1] = ... | 1,387 |
def residue(b,a,tol=1e-3): """Compute partial-fraction expansion of b(s) / a(s). If M = len(b) and N = len(a) b(s) b[0] x**(M-1) + b[1] x**(M-2) + ... + b[M-1] H(s) = ------ = ---------------------------------------------- a(s) b[0] x**(M-1) + b[1] x**(M-2) + ... + b[M-1] r[0] r[1] r[-1] = ... | def residue(b,a,tol=1e-3): """Compute partial-fraction expansion of b(s) / a(s). If M = len(b) and N = len(a) b(s) b[0] x**(M-1) + b[1] x**(M-2) + ... + b[M-1] H(s) = ------ = ---------------------------------------------- a(s) b[0] x**(M-1) + b[1] x**(M-2) + ... + b[M-1] r[0] r[1] r[-1] = ... | 1,388 |
def residue(b,a,tol=1e-3): """Compute partial-fraction expansion of b(s) / a(s). If M = len(b) and N = len(a) b(s) b[0] x**(M-1) + b[1] x**(M-2) + ... + b[M-1] H(s) = ------ = ---------------------------------------------- a(s) b[0] x**(M-1) + b[1] x**(M-2) + ... + b[M-1] r[0] r[1] r[-1] = ... | def residue(b,a,tol=1e-3): """Compute partial-fraction expansion of b(s) / a(s). If M = len(b) and N = len(a) b(s) b[0] x**(M-1) + b[1] x**(M-2) + ... + b[M-1] H(s) = ------ = ---------------------------------------------- a(s) b[0] x**(M-1) + b[1] x**(M-2) + ... + b[M-1] r[0] r[1] r[-1] = ... | 1,389 |
def residue(b,a,tol=1e-3): """Compute partial-fraction expansion of b(s) / a(s). If M = len(b) and N = len(a) b(s) b[0] x**(M-1) + b[1] x**(M-2) + ... + b[M-1] H(s) = ------ = ---------------------------------------------- a(s) b[0] x**(M-1) + b[1] x**(M-2) + ... + b[M-1] r[0] r[1] r[-1] = ... | def residue(b,a,tol=1e-3): """Compute partial-fraction expansion of b(s) / a(s). If M = len(b) and N = len(a) b(s) b[0] x**(M-1) + b[1] x**(M-2) + ... + b[M-1] H(s) = ------ = ---------------------------------------------- a(s) b[0] x**(M-1) + b[1] x**(M-2) + ... + b[M-1] r[0] r[1] r[-1] = ... | 1,390 |
def draw_graph_area(self,dc=None): if not dc: dc = wx.wxClientDC(self) self.layout_data() # just to check how real time plot would go... | def draw_graph_area(self,dc=None): if not dc: dc = wx.wxClientDC(self) self.layout_data() # just to check how real time plot would go... | 1,391 |
def configuration(parent_package=''): from interface_gen import generate_interface config = default_config_dict('linalg',parent_package) local_path = get_path(__name__) test_path = os.path.join(local_path,'tests') config['packages'].append(dot_join(parent_package,'linalg.tests')) config['package_dir']['linalg.tests'] ... | def configuration(parent_package=''): from interface_gen import generate_interface config = default_config_dict('linalg',parent_package) local_path = get_path(__name__) test_path = os.path.join(local_path,'tests') config['packages'].append(dot_join(parent_package,'linalg.tests')) config['package_dir']['linalg.tests'] ... | 1,392 |
def residuez(b,a,tol=1e-3,rtype='avg'): """Compute partial-fraction expansion of b(z) / a(z). If M = len(b) and N = len(a) b(z) b[0] + b[1] z**(-1) + ... + b[M-1] z**(-M+1) H(z) = ------ = ---------------------------------------------- a(z) a[0] + a[1] z**(-1) + ... + a[N-1] z**(-N+1) r[0] ... | def residuez(b,a,tol=1e-3,rtype='avg'): """Compute partial-fraction expansion of b(z) / a(z). If M = len(b) and N = len(a) b(z) b[0] + b[1] z**(-1) + ... + b[M-1] z**(-M+1) H(z) = ------ = ---------------------------------------------- a(z) a[0] + a[1] z**(-1) + ... + a[N-1] z**(-N+1) r[0] ... | 1,393 |
def zoom(a_lo, a_hi, phi_lo, phi_hi, derphi_lo, phi, derphi, phi0, derphi0, c1, c2): fc = gc = 0 maxiter = 10 i = 0 while 1: # interpolate to find a trial step length between a_lo and a_hi A = phi_lo; B = derphi_lo; dalpha = a_hi-a_lo; C = (phi_hi - phi_lo - dalpha*derphi_lo)/dalpha**2; if (c<=0) or (i%3)==2): # Use bi... | def zoom(a_lo, a_hi, phi_lo, phi_hi, derphi_lo, phi, derphi, phi0, derphi0, c1, c2): maxiter = 10 i = 0 while 1: # interpolate to find a trial step length between a_lo and a_hi A = phi_lo; B = derphi_lo; dalpha = a_hi-a_lo; C = (phi_hi - phi_lo - dalpha*derphi_lo)/dalpha**2; if (c<=0) or (i%3)==2): # Use bisection a_j ... | 1,394 |
def zoom(a_lo, a_hi, phi_lo, phi_hi, derphi_lo, phi, derphi, phi0, derphi0, c1, c2): fc = gc = 0 maxiter = 10 i = 0 while 1: # interpolate to find a trial step length between a_lo and a_hi A = phi_lo; B = derphi_lo; dalpha = a_hi-a_lo; C = (phi_hi - phi_lo - dalpha*derphi_lo)/dalpha**2; if (c<=0) or (i%3)==2): # Use bi... | def zoom(a_lo, a_hi, phi_lo, phi_hi, derphi_lo, phi, derphi, phi0, derphi0, c1, c2): fc = gc = 0 maxiter = 10 i = 0 while 1: # interpolate to find a trial step length between a_lo and a_hi A = phi_lo; B = derphi_lo; dalpha = a_hi-a_lo; C = (phi_hi - phi_lo - dalpha*derphi_lo)/dalpha**2; if (C<=0) or ((i%3)==2): # Use b... | 1,395 |
def zoom(a_lo, a_hi, phi_lo, phi_hi, derphi_lo, phi, derphi, phi0, derphi0, c1, c2): fc = gc = 0 maxiter = 10 i = 0 while 1: # interpolate to find a trial step length between a_lo and a_hi A = phi_lo; B = derphi_lo; dalpha = a_hi-a_lo; C = (phi_hi - phi_lo - dalpha*derphi_lo)/dalpha**2; if (c<=0) or (i%3)==2): # Use bi... | def zoom(a_lo, a_hi, phi_lo, phi_hi, derphi_lo, phi, derphi, phi0, derphi0, c1, c2): fc = gc = 0 maxiter = 10 i = 0 while 1: # interpolate to find a trial step length between a_lo and a_hi A = phi_lo; B = derphi_lo; dalpha = a_hi-a_lo; C = (phi_hi - phi_lo - dalpha*derphi_lo)/dalpha**2; if (c<=0) or (i%3)==2): # Use bi... | 1,396 |
def zoom(a_lo, a_hi, phi_lo, phi_hi, derphi_lo, phi, derphi, phi0, derphi0, c1, c2): fc = gc = 0 maxiter = 10 i = 0 while 1: # interpolate to find a trial step length between a_lo and a_hi A = phi_lo; B = derphi_lo; dalpha = a_hi-a_lo; C = (phi_hi - phi_lo - dalpha*derphi_lo)/dalpha**2; if (c<=0) or (i%3)==2): # Use bi... | def zoom(a_lo, a_hi, phi_lo, phi_hi, derphi_lo, phi, derphi, phi0, derphi0, c1, c2): fc = gc = 0 maxiter = 10 i = 0 while 1: # interpolate to find a trial step length between a_lo and a_hi A = phi_lo; B = derphi_lo; dalpha = a_hi-a_lo; C = (phi_hi - phi_lo - dalpha*derphi_lo)/dalpha**2; if (c<=0) or (i%3)==2): # Use bi... | 1,397 |
def zoom(a_lo, a_hi, phi_lo, phi_hi, derphi_lo, phi, derphi, phi0, derphi0, c1, c2): fc = gc = 0 maxiter = 10 i = 0 while 1: # interpolate to find a trial step length between a_lo and a_hi A = phi_lo; B = derphi_lo; dalpha = a_hi-a_lo; C = (phi_hi - phi_lo - dalpha*derphi_lo)/dalpha**2; if (c<=0) or (i%3)==2): # Use bi... | def zoom(a_lo, a_hi, phi_lo, phi_hi, derphi_lo, phi, derphi, phi0, derphi0, c1, c2): fc = gc = 0 maxiter = 10 i = 0 while 1: # interpolate to find a trial step length between a_lo and a_hi A = phi_lo; B = derphi_lo; dalpha = a_hi-a_lo; C = (phi_hi - phi_lo - dalpha*derphi_lo)/dalpha**2; if (c<=0) or (i%3)==2): # Use bi... | 1,398 |
def phiprime(alpha): return Num.dot(fprime(xk+alpha*pk,*args),pk) | def phiprime(alpha): return Num.dot(fprime(xk+alpha*pk,*args),pk) | 1,399 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.