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

网站建设公司 预算可以做描文本的网站

网站建设公司 预算,可以做描文本的网站,android wordpress,wordpress 静态化 linux参考链接#xff1a; Python中的Array | 数组1(简介和功能) 一、list和array的区别 Python的数组通过Numpy包的array实现。 Python里二者最大的区别是#xff0c;list可以存储不同类型的数据#xff0c;而array只能存储相同类型的数据。 import numpy #直接定义 a […参考链接 Python中的Array | 数组1(简介和功能) 一、list和array的区别  Python的数组通过Numpy包的array实现。 Python里二者最大的区别是list可以存储不同类型的数据而array只能存储相同类型的数据。  import numpy #直接定义 a [1,2,3,4,5]   #列表list可以混合类型 b numpy.array([1,2,3,4,5])        #数字数组array c numpy.array([1,2,3,4,5])      #字符数组array #打印出来也有不同 print(a)    #[1, 2, 3, 4] print(b)    #[1 2 3] print(c)    #[1 2 3 4 5] #生成值为连续数字的对象 a1 list(range(5)) b1 numpy.arange(5) #打印结果 print(a1)   #[0, 1, 2, 3, 4] print(b1)   #[0 1 2 3 4] 二、创建数组的方法  一 numpy.empty 创建未初始化的数组非空元素为随机值  numpy.empty(shape, dtype float, order ‘C’) 参数列表分别为形状数据类型在计算机中的存储为行优先 ‘C’ 或者列优先 ‘F’。  import numpy  x numpy.empty([3,2], dtype int)  print(x) [[0 0] [0 0] [0 0]] 二 numpy.zeros 创建元素为 0 的数组  numpy.zeros(shape, dtype float, order ‘C’)  import numpy y numpy.zeros((2,2), dtypeint) print(y) [[0 0] [0 0]] 三 numpy.ones 创建元素为 1 的数组  import numpy z numpy.ones((2,2))    #这几个创建方式都需要注意第一个参数的形式 print(z) [[1. 1.] [1. 1.]]  四 numpy.asarray 根据已有的元组或者列表创建数组  numpy.asarray(a, dtype None, order None) 这是从列表转换为数组的例子  import numpy x [[1,2,3],[4,5,6]]   #需要注意原列表的形式 y [[1,2,3],[4,5]] z [[1,2,3],[4,5,6]] q [[1,2,3],[4,5,6]] a numpy.asarray(x) b numpy.asarray(y) c numpy.asarray(z) d numpy.asarray(q,dtypefloat) print(a) print(b) print(c) print(d) [[1 2 3] [4 5 6]] [list([1, 2, 3]) list([4, 5])] [[1 2 3] [4 5 6]] [[1. 2. 3.] [4. 5. 6.]] 五 numpy.frombuffer 流形式读入转换为数组  numpy.frombuffer(buffer, dtype float, count -1, offset 0) 细节太多不讨论了需要的时候再看  六 numpy.fromiter 从可迭代对象创建数组返回一维数组  numpy.fromiter(iterable, dtype, count-1) count为读取的数据数量默认为-1读取所有数据  import numpy x range(5) it iter(x) a numpy.fromiter(x, dtypefloat) print(a) [0. 1. 2. 3. 4.] 七 numpy.arange 从数值范围创建数组  numpy.arange(start, stop, step, dtype)  import numpy a numpy.arange(5) print(a) [0 1 2 3 4] 八 numpy.linspace 创建等差数列一维数组  numpy.linspace(start, stop, num50, endpointTrue, retstepFalse, dtypeNone) num为数量endpoint为真时stop被包含在数列中retstep为真时显示间距  import numpy a numpy.linspace(0,100,11) b numpy.linspace(0,100,11,retstep True, dtypeint) print(a) print(b) [  0.  10.  20.  30.  40.  50.  60.  70.  80.  90. 100.] (array([  0,  10,  20,  30,  40,  50,  60,  70,  80,  90, 100]), 10.0) 九 numpy.logspace 创建等比数列一维数组  numpy.logspace(start, stop, num50, endpointTrue, base10.0, dtypeNone) 序列的起始值为base**start base为底的start次方 序列的终止值为base ** stop base为底的stop次方 如果endpoint为true该值包含于数列中 base为log的底数  import numpy a numpy.logspace(1, 4, 4, base3, dtype int) b numpy.logspace(1, 10, 10, base2) print(a) print(b) [ 3  9 27 81] [   2.    4.    8.   16.   32.   64.  128.  256.  512. 1024.] 三、array的操作  一 reshape 整形  import numpy a numpy.arange(6) b a.reshape(3,2)    #改变数组形状参数是行数和列数需要匹配原数组的元素数量否则报错 print(a) print(b) [0 1 2 3 4 5 6 7] [[0 1] [2 3] [4 5] [6 7]] 二 flat 数组迭代器  import numpy #一维数组可以直接for循环迭代 a numpy.arange(6) for x in a: print(x) b numpy.arange(6).reshape(3,2)    #二维数组 #flat迭代器 for x in b.flat: print(x) #多重for循环跟迭代器二者等效 for x in b:  for y in x:  print(y) 三 flatten 深拷贝同copy()  ndarray.flatten(order‘C’) order‘C’ – 按行‘F’ – 按列‘A’ – 原顺序‘K’ – 元素在内存中的出现顺序。  import numpy a numpy.arange(4) ba.copy() ca.flatten() a[1] 8 b[0] 9 print(a) print(b) print(c) [0 8 2 3] [9 1 2 3] [0 1 2 3] 四 ravel 返回数组的视图修改会影响原数组  numpy.ravel(a, order‘C’) order‘C’ – 按行‘F’ – 按列‘A’ – 原顺序‘K’ – 元素在内存中的出现顺序。  import numpy a numpy.arange(8).reshape(2,4) b a.ravel() c a.ravel(order F)    # 就这个修改不会影响其他的 d a.ravel(order A) e a.ravel(order K) print(a) print(b) print(c) print(d) print(e) [[0 1 2 3] [4 5 6 7]] [0 1 2 3 4 5 6 7] [0 4 1 5 2 6 3 7] [0 1 2 3 4 5 6 7] [0 1 2 3 4 5 6 7] 注意修改orderF’模式的时候不会影响其他模式的序列没有深究为何用的时候再找。  b[4] 44 c[5] 55 d[6] 66 e[7] 77 print(a) print(b) print(c) print(d) print(e) [[ 0  1  2  3] [44  5 66 77]] [ 0  1  2  3 44  5 66 77] [ 0  4  1  5  2 55  3  7] [ 0  1  2  3 44  5 66 77] [ 0  1  2  3 44  5 66 77] 五 transpose 等同于T翻转数组行和列  numpy.transpose(arr, axes) arr要操作的数组 axes整数列表对应维度通常所有维度都会对换。  import numpy a numpy.arange(6).reshape(2,3) b a.transpose() c a.T     #注意写法 print(a) print(b) print(c) [[0 1 2] [3 4 5]] [[0 3] [1 4] [2 5]] [[0 3] [1 4] [2 5]] 六 后面暂时略以后补完
http://wiki.neutronadmin.com/news/224536/

相关文章:

  • 郑州网站建设 seodz增加网站标签
  • 现在做什么网站好产品平面广告设计
  • 五金网站方案企业宣传网站建设内容
  • 唐山网站设计公司天津营销型网站建设公司
  • seo排行榜年度10佳网站苍溪规划和建设局网站
  • 用什么程序做网站最好优化个人网站源代码下载
  • 免费做网站哪里有免费ftp服务器空间
  • 网站营销方法学习网首页
  • 网站建设高校怎样做淘客网站
  • 做网站工作条件做新闻微网站有哪些方面
  • 北京市两学一做网站wordpress更改链接后网站打不开
  • 平台制作专业网站制作如何做网站轮播图和菜单全屏
  • 汽配网站开发wordpress导入数据库
  • 珠海网站建设维护网站设计评价
  • 电子商务网站建设实训实践总结wordpress迁服务器
  • 专业做医院网站vs2010网站开发登录代码
  • 诗人做的网站公司内部网站建设
  • 邢台做网站的价格究竟多少钱?wordpress的首页
  • 网站关键词的选择培训机构招生方案范文
  • 照片一键生成视频的软件怀化百度整站优化服务
  • 龙华建网站商城网站设计公司
  • 企业网站开发公司-北京公司延边州住房城乡建设局网站
  • 做网站的疑问有哪些网站建设售后服务合同
  • 做视频网站广告收费惠州自动seo
  • 网站建设与管理期末考试东莞主页网站制作
  • 小视频网站开发流程图成都私人视频网站制作平台
  • 哪个网站做调查赚钱多wordpress 防爬
  • 现在怎么建设一个网站wordpress logy
  • 设计比较有特色的网站哈尔滨百度推广排名优化
  • 什么样的公司愿意做网站软文撰写公司