摘要: import numpy as np #Create an array of 1*10^7 elements arr = np.arange(1e7) #Converting ndarray to list larr = arr.tolist() #Create a 2D numpy array arr = np.zeros((3,3)) #Converting a array to m... 阅读全文
posted @ 2017-04-11 16:02 KennyRom 阅读(469) 评论(0) 推荐(0) 编辑
摘要: zip() is a built-in function. This function returns a list of tuples, where the i-th tuple contains the i-th element from each of the argument sequenc 阅读全文
posted @ 2017-04-11 15:49 KennyRom 阅读(185) 评论(0) 推荐(0) 编辑
摘要: numpy.logspace(start, stop, num=50, endpoint=True, base=10.0, dtype=None) starting value := base**start stopping value := base**stop base = 10.0 := th 阅读全文
posted @ 2017-04-11 15:00 KennyRom 阅读(1102) 评论(0) 推荐(0) 编辑
摘要: 利用线性函数做插值 每一段的线性函数: 阅读全文
posted @ 2017-03-28 19:10 KennyRom 阅读(7506) 评论(0) 推荐(1) 编辑
摘要: # -*- coding: utf-8 -*- #Program 0.5 Hermite Interpolation import matplotlib.pyplot as plt import numpy as np #计算基函数的导数值 def dl(i, xi): result = 0.0 for j in range(0,len(xi)): if... 阅读全文
posted @ 2017-03-27 11:58 KennyRom 阅读(4587) 评论(0) 推荐(1) 编辑
摘要: 插值公式为: 差商递归公式为: 阅读全文
posted @ 2017-03-27 10:28 KennyRom 阅读(2777) 评论(1) 推荐(1) 编辑
摘要: #-*— coding:utf-8 -*- #Program 0.3 Lagrange Interpolation import matplotlib.pyplot as plt import numpy as np import scipy as np import random #随机生成10个介于(-255,255)的结点 def getdata(): a = np.zeros(10... 阅读全文
posted @ 2017-03-27 09:09 KennyRom 阅读(1454) 评论(0) 推荐(0) 编辑
摘要: numpy.nonzero(a) Return the indices of the elements that are non-zero. Returns a tuple of arrays, one for each dimension of a, containing the indices 阅读全文
posted @ 2017-03-26 09:53 KennyRom 阅读(264) 评论(0) 推荐(0) 编辑
摘要: numpy.random.rand Random values in a given shape. Create an array of the given shape and populate it with random samples from a uniform distribution o 阅读全文
posted @ 2017-03-23 22:34 KennyRom 阅读(326) 评论(0) 推荐(0) 编辑
摘要: numpy.mat Unlike matrix, asmatrix does not make a copy if the input is already a matrix or an ndarray. Equivalent to matrix(data, copy=False). data : 阅读全文
posted @ 2017-03-23 22:26 KennyRom 阅读(339) 评论(0) 推荐(0) 编辑