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

桃子网站logo找不同 网站开发

桃子网站logo,找不同 网站开发,成都市金牛区建设和交通局网站,定制软件开发报价锋哥原创的Pandas2 Python数据处理与分析 视频教程: 2025版 Pandas2 Python数据处理与分析 视频教程(无废话版) 玩命更新中~_哔哩哔哩_bilibili NumPy数组创建最常用的方式是直接创建, numpy 可以直接创建或者将 python的其他元素转为 array 对象。 下…

锋哥原创的Pandas2 Python数据处理与分析 视频教程:  

2025版 Pandas2 Python数据处理与分析 视频教程(无废话版) 玩命更新中~_哔哩哔哩_bilibili

NumPy数组创建最常用的方式是直接创建, numpy 可以直接创建或者将 python的其他元素转为 array 对象。 下面来看多维数组的创建

import numpy as np
​
# 创建一维数组
a1 = np.array([0, 1, 2])
print(a1, type(a1))
​
# 创建二维数组
a2 = np.array([[0, 1, 2], [3, 4, 5], [6, 7, 8]])
print(a2, type(a2))
​
# 创建三维数组
a3 = np.array([[[0, 1, 2], [3, 4, 5], [6, 7, 8]], [[9, 10, 11], [12, 13, 14], [15, 16, 17]],[[18, 19, 20], [21, 22, 23], [24, 25, 26]]])
print(a3, type(a3))

运行输出:

[0 1 2] <class 'numpy.ndarray'>
[[0 1 2][3 4 5][6 7 8]] <class 'numpy.ndarray'>
[[[ 0  1  2][ 3  4  5][ 6  7  8]]
​[[ 9 10 11][12 13 14][15 16 17]]
​[[18 19 20][21 22 23][24 25 26]]] <class 'numpy.ndarray'>
​
Process finished with exit code 0

除了直接创建多维数组,也可以采用常见的函数进行创建

n1 = np.zeros(10)  # 生成10个浮点型0
n2 = np.ones(8)  # 生成8个浮点型1
n3 = np.empty(9)  # 生成9个随机值,很夸张的随机值
n4 = np.arange(10)  # 生成10个,不包括10,步长1,默认从0开始
n5 = np.ones_like(n4)  # 生成与n4结构一样的1值
n6 = np.zeros_like(n4)  # 生成与n4结构一样的0值
n7 = np.empty_like(n4)  # 生成与n4结构一样的随机值
print(n1)
print(n2)
print(n3)
print(n4)
print(n5)
print(n6)
print(n7)

运行输出:

[0. 0. 0. 0. 0. 0. 0. 0. 0. 0.]
[1. 1. 1. 1. 1. 1. 1. 1.]
[0.00000000e+000 0.00000000e+000 0.00000000e+000 0.00000000e+0000.00000000e+000 2.58890398e-321 0.00000000e+000 1.02658998e-3001.38258698e-316]
[0 1 2 3 4 5 6 7 8 9]
[1 1 1 1 1 1 1 1 1 1]
[0 0 0 0 0 0 0 0 0 0]
[ 251076211860373504                1631  1047090478771077120      15891387121664                   02933462663846 3202622285013843968                19084853313044480]

还有一些常用的高级用法:

print(np.arange(2, 10, 0.5))  # 从2开始,步长0.5 ,不超过10
print(np.linspace(3, 6, num=5, endpoint=True))  # 从3到6,生成均匀的5个值,包括最终值6
print(np.random.randn(3, 4))  # 返回一个3行4列的随机数组,浮点型
print(np.random.randint(0, 10, size=(3, 4)))  # 返回一个3行4列的随机数组,整型,随机值范围0到9
print(np.random.randint(0, 10, size=(3, 3, 3)))  # 返回一个3维数组,整型,随机值范围0到9

运行输出:

[2.  2.5 3.  3.5 4.  4.5 5.  5.5 6.  6.5 7.  7.5 8.  8.5 9.  9.5]
[3.   3.75 4.5  5.25 6.  ]
[[ 0.74793299 -0.05223858  0.32494228  1.24623639][ 1.09356216 -0.59055563 -1.27056592 -0.12965195][ 0.05077383  1.91432252  0.58686216 -0.85051921]]
[[2 0 5 5][1 3 5 0][1 1 2 8]]
[[[1 5 8][8 9 4][4 3 3]]
​[[9 3 4][9 7 4][5 4 1]]
​[[6 9 4][8 8 8][5 3 9]]]


文章转载自:

http://00000000.frmmp.cn
http://00000000.frmmp.cn
http://00000000.frmmp.cn
http://00000000.frmmp.cn
http://00000000.frmmp.cn
http://00000000.frmmp.cn
http://00000000.frmmp.cn
http://00000000.frmmp.cn
http://00000000.frmmp.cn
http://00000000.frmmp.cn
http://00000000.frmmp.cn
http://00000000.frmmp.cn
http://00000000.frmmp.cn
http://00000000.frmmp.cn
http://00000000.frmmp.cn
http://00000000.frmmp.cn
http://00000000.frmmp.cn
http://00000000.frmmp.cn
http://00000000.frmmp.cn
http://00000000.frmmp.cn
http://00000000.frmmp.cn
http://00000000.frmmp.cn
http://00000000.frmmp.cn
http://00000000.frmmp.cn
http://00000000.frmmp.cn
http://00000000.frmmp.cn
http://00000000.frmmp.cn
http://00000000.frmmp.cn
http://00000000.frmmp.cn
http://00000000.frmmp.cn
http://www.dtcms.com/wzjs/619611.html

相关文章:

  • 青岛建设教育网站做电影网站怎么降低内存
  • 苏州网站建设布局seo流量是什么意思
  • 兰州模板型网站建设临沂百度网站推广
  • 有哪些好的网站建设保定网站seo费用
  • 现在建个企业网站要多少钱post wordpress
  • 读书网站怎么做桂林到阳朔怎么走最方便
  • 超值的网站建设梅州企业网站建设公司
  • 做单页面网站山西做网站推广
  • wordpress游戏网站主题做招牌的广告公司
  • 合肥快速建站在线咨询佛山企业网站推广
  • 网站建设经费预算表信息流优化师是什么
  • 网站线框图用什么做百讯科技网站建设
  • 奇缦科技珠海网站建设优化购物网站排行榜
  • 大网站的建设重点wordpress 模版 婚礼
  • 安卓端网站开发ide如何做网站来做淘宝客
  • 网站建设的技术有哪些内容seo技术培训山东
  • 无锡网站建设专注千客云网络学校的网站的代码模板下载
  • 苏州网站建设科技中国wordpress用的人少
  • 网站** 教程深圳宝安区必去景点
  • 网站建设服务标准化wordpress安装大淘客
  • 如何做网站域名装修室内设计效果图
  • 网站建设哪家好推荐万维科技网站建设风险评估
  • 外贸soho建站公司网站开发的目的
  • 电子网站建设考试网络营销师资格证
  • 网站建设教程视频西瓜全国信用网站一体化建设
  • 做网站的竞品分析营销网站建设是什么意思
  • 可以带锚文本的网站哪有做企业网站
  • 做cpa的网站源码php网站开发工程师面试
  • 海珠建网站多少钱福州优秀网站建设公司
  • 如何把网站做的更好杭州蒙特网站建设