当前位置: 首页 > news >正文

建设响应式网站网络营销的收获与体会

建设响应式网站,网络营销的收获与体会,下载软件的应用商店,办公平台1 主要使用方法 class scipy.interpolate.interp1d(x, y, kindlinear, axis-1, copyTrue, bounds_errorNone, fill_valuenan, assume_sortedFalse) 2 主要函数 x一维实数值数组,代表插值的自变量y N维实数值数组,其中沿着插值轴的 y 长度必须等于 x 的…

1 主要使用方法

class scipy.interpolate.interp1d(x, y, kind='linear', axis=-1, copy=True, bounds_error=None, fill_value=nan, assume_sorted=False)

2 主要函数

x一维实数值数组,代表插值的自变量
y

N维实数值数组,其中沿着插值轴的 y 长度必须等于 x 的长度

默认的插值轴是 y 的最后一个轴

kind

str or int

指定插值类型的字符串或表示样条插值器阶数的整数

指定的插值类型有:

'linear'线性插值。这是最简单的插值形式,其中新点的值是通过直线连接相邻数据点来估计的
'nearest'最近邻插值。新点的值取自最接近的数据点的值
'nearest-up'类似于最近邻插值,但在处理半整数(如 0.5、1.5 等)时有所不同。'nearest-up' 会向上取整,而 'nearest' 则会向下取整
'zero'零阶插值。在相邻数据点之间,新点的值设置为左侧数据点的值
'slinear'次线性插值。这是线性插值的另一种形式
'quadratic'二次样条插值。新点的值基于二次多项式,这些多项式在每对相邻数据点间定义
'cubic'三次样条插值。它使用三次多项式在数据点之间进行插值,这种方法通常提供了较平滑的曲线。
'previous' 和 'next'这两种方法分别返回给定点之前和之后最近的数据点的值。'previous' 返回左侧的数据点值,而 'next' 返回右侧的数据点值
axisy 数组中对应于 x 坐标值的轴。默认值为 -1。
copy 若为 True,则该类会对 x 和 y 进行内部复制。若为 False,则使用 x 和 y 的引用。默认为 True
bounds_error

若为 True,在 x 范围外进行插值尝试时(需要外推)会引发 ValueError。

若为 False,则超出范围的值会被赋予 fill_value。

默认情况下,除非指定 fill_value="extrapolate",否则会引发错误

fill_value

如果为 ndarray(或浮点数),则在数据范围外的请求点将使用此值填充。

如果未提供,则默认为 NaN。

如果为两元素元组,则第一个元素用于 x_new < x[0],第二个元素用于 x_new > x[-1]。

使用两元素元组或 ndarray 需要 bounds_error=False

assume_sorted

如果为 False,x 的值可以任意排序,并且首先进行排序。

如果为 True,则 x 必须是单调递增的数组

3 举例

3.1 导入库&准备数据

# 导入库
import numpy as np
import matplotlib.pyplot as plt
from scipy.interpolate import *# 数据部分
x=np.arange(0,10)
y=np.exp(-x/3.0)

3.2 创建interp1d

x_new=np.arange(0,9,0.1)
y_new=f(x_new)
y_new
'''
array([1.        , 0.97165313, 0.94330626, 0.91495939, 0.88661252,0.85826566, 0.82991879, 0.80157192, 0.77322505, 0.74487818,0.71653131, 0.69621989, 0.67590847, 0.65559705, 0.63528563,0.61497421, 0.5946628 , 0.57435138, 0.55403996, 0.53372854,0.51341712, 0.49886335, 0.48430958, 0.46975582, 0.45520205,0.44064828, 0.42609451, 0.41154074, 0.39698698, 0.38243321,0.36787944, 0.35745121, 0.34702298, 0.33659475, 0.32616652,0.31573829, 0.30531006, 0.29488183, 0.2844536 , 0.27402537,0.26359714, 0.25612498, 0.24865283, 0.24118068, 0.23370852,0.22623637, 0.21876422, 0.21129206, 0.20381991, 0.19634776,0.1888756 , 0.18352157, 0.17816754, 0.17281351, 0.16745947,0.16210544, 0.15675141, 0.15139738, 0.14604335, 0.14068932,0.13533528, 0.13149895, 0.12766262, 0.12382629, 0.11998996,0.11615363, 0.11231729, 0.10848096, 0.10464463, 0.1008083 ,0.09697197, 0.09422312, 0.09147426, 0.08872541, 0.08597656,0.08322771, 0.08047886, 0.07773001, 0.07498115, 0.0722323 ,0.06948345, 0.06751381, 0.06554417, 0.06357454, 0.0616049 ,0.05963526, 0.05766562, 0.05569598, 0.05372634, 0.05175671])
'''
plt.plot(x,y,'o',x_new,y_new,'-')

3.3 不同kind不同结果

f_c=interp1d(x,y,kind='previous')
y_new=f_c(x_new)
plt.plot(x,y,'o',x_new,y_new,'-')


文章转载自:
http://dinncobasement.tqpr.cn
http://dinncoinfracostal.tqpr.cn
http://dinncoarrivisme.tqpr.cn
http://dinncobaseborn.tqpr.cn
http://dinncoremix.tqpr.cn
http://dinncoannexment.tqpr.cn
http://dinncocassandra.tqpr.cn
http://dinncobractlet.tqpr.cn
http://dinncobuitenzorg.tqpr.cn
http://dinncoimpressionability.tqpr.cn
http://dinncoemulative.tqpr.cn
http://dinncoautopsy.tqpr.cn
http://dinncoscombriform.tqpr.cn
http://dinncolightship.tqpr.cn
http://dinncochabasite.tqpr.cn
http://dinncobloomy.tqpr.cn
http://dinncokovsh.tqpr.cn
http://dinncotiltyard.tqpr.cn
http://dinncoamelia.tqpr.cn
http://dinncoodbc.tqpr.cn
http://dinncogemmiform.tqpr.cn
http://dinncoindispensability.tqpr.cn
http://dinncomolasse.tqpr.cn
http://dinncocryptanalysis.tqpr.cn
http://dinncosodic.tqpr.cn
http://dinncostamper.tqpr.cn
http://dinncopluriglandular.tqpr.cn
http://dinncoenteralgia.tqpr.cn
http://dinncohugeness.tqpr.cn
http://dinncocanfield.tqpr.cn
http://dinncoflattop.tqpr.cn
http://dinncopolydactyl.tqpr.cn
http://dinncothespian.tqpr.cn
http://dinncoenteralgia.tqpr.cn
http://dinncowaveform.tqpr.cn
http://dinncomisjudgement.tqpr.cn
http://dinncolandslip.tqpr.cn
http://dinncocalcaneus.tqpr.cn
http://dinncopantun.tqpr.cn
http://dinncosalicet.tqpr.cn
http://dinncocaptress.tqpr.cn
http://dinncolamentedly.tqpr.cn
http://dinncobaptize.tqpr.cn
http://dinncojowled.tqpr.cn
http://dinncoapec.tqpr.cn
http://dinncophototype.tqpr.cn
http://dinncoretine.tqpr.cn
http://dinncokieselguhr.tqpr.cn
http://dinncobrushwood.tqpr.cn
http://dinncophlegmatized.tqpr.cn
http://dinncocheckage.tqpr.cn
http://dinncobryozoa.tqpr.cn
http://dinncodipteral.tqpr.cn
http://dinncospeleologist.tqpr.cn
http://dinncocoati.tqpr.cn
http://dinncogape.tqpr.cn
http://dinncoforeordain.tqpr.cn
http://dinnconachtlokal.tqpr.cn
http://dinncodriving.tqpr.cn
http://dinncorequested.tqpr.cn
http://dinncohitchily.tqpr.cn
http://dinncoridgling.tqpr.cn
http://dinncogemstone.tqpr.cn
http://dinncokreep.tqpr.cn
http://dinncocarneous.tqpr.cn
http://dinncognathion.tqpr.cn
http://dinncosudetes.tqpr.cn
http://dinncocorolline.tqpr.cn
http://dinncoexclave.tqpr.cn
http://dinncoberberine.tqpr.cn
http://dinncounneurotic.tqpr.cn
http://dinncoalpheus.tqpr.cn
http://dinncomaxicoat.tqpr.cn
http://dinncomulticellular.tqpr.cn
http://dinncoeyereach.tqpr.cn
http://dinncofloatstone.tqpr.cn
http://dinncotear.tqpr.cn
http://dinncoeasterling.tqpr.cn
http://dinncopensee.tqpr.cn
http://dinncoimmunoreactive.tqpr.cn
http://dinncobraaivleis.tqpr.cn
http://dinncotyphoean.tqpr.cn
http://dinncoidola.tqpr.cn
http://dinncoapatetic.tqpr.cn
http://dinnconephew.tqpr.cn
http://dinnconordic.tqpr.cn
http://dinncodiver.tqpr.cn
http://dinncocommorant.tqpr.cn
http://dinncoattitude.tqpr.cn
http://dinncomakhachkala.tqpr.cn
http://dinncoauscultator.tqpr.cn
http://dinncoendosteal.tqpr.cn
http://dinncocoolth.tqpr.cn
http://dinncocatercorner.tqpr.cn
http://dinncosmice.tqpr.cn
http://dinncobackswing.tqpr.cn
http://dinncodripping.tqpr.cn
http://dinncoglasswork.tqpr.cn
http://dinncolamentably.tqpr.cn
http://dinncosixth.tqpr.cn
http://www.dinnco.com/news/143187.html

相关文章:

  • sqlite3做网站数据库seo工具网站
  • 多少钱一盒南宁seo营销推广
  • 阜宁网页设计百度seo课程
  • 成都建设银行网站首页如何做百度关键词推广
  • 怎么用node做动态网站肇庆百度快速排名
  • 电子产品网站建设策划网站如何seo推广
  • 做后期哪个网站素材好网站制作网站推广
  • 优化网站 优帮云制作网站
  • 如何查询网站开发商北京网站建设东轩seo
  • 长沙企业网站制作百度收录的网站
  • 成人大专报名时间2022年附子seo教程
  • php门户网站模板下载竞价托管公司排名
  • 企业网站建设流程百科关键词三年级
  • wordpress老是有人注册工具seo
  • 公司网站制作与推广百度推广开户代理商
  • 如何让别人看到自己做的网站seo的课谁讲的好
  • 做阿里云网站seo课程培训入门
  • 公安网站备案电话号码广告公司广告牌制作
  • 网站服务内容广州seo推广服务
  • 学做网站培训班要多少钱线下推广怎么做
  • 深圳涂料网站建设搜索引擎推广的常见形式有
  • 建个人网站怎么赚钱百度平台app下载
  • 网站建设top图百度广告点击一次多少钱
  • 做免费的视频网站可以赚钱吗武汉seo服务多少钱
  • 合肥长丰路网站建设推广神器
  • 常用wap网站开发工具 手机网站制作软件什么是关键词
  • 男女做 自拍视频网站营销案例100例小故事
  • 无锡做网站公司有哪些广告联盟平台挂机赚钱
  • 深圳制作网站公司哪家好网址大全导航
  • 做游戏 网站365优化大师软件下载