当前位置:网站首页>Numpy中np.meshgrid的简单用法示例
Numpy中np.meshgrid的简单用法示例
2022-07-31 04:55:00 【bksheng】
机器学习中经常会用到np.meshgrid()
含义:生成网格点坐标
代码示例:
a = [2,3,5]
b = [1,4,7,9]
A,B = np.meshgrid(a,b)
print('A\n',A) # 把a当作一行,再根据b的个数进行扩充。
print('B\n',B) # 把b当作一列,再根据a的个数进行扩充。
plt.scatter(A,B) # 得到的A,B形状一致,可以将A,B对应组合成(x,y)坐标,绘制出网格点。
执行结果:
A
[[2 3 5]
[2 3 5]
[2 3 5]
[2 3 5]]
B
[[1 1 1]
[4 4 4]
[7 7 7]
[9 9 9]]
散点图:
边栏推荐
- mysql使用on duplicate key update批量更新数据
- Reinforcement learning: from entry to pit to shit
- Win10 CUDA CUDNN installation configuration (torch paddlepaddle)
- Mysql应用安装后找不到my.ini文件
- open failed: EACCES (Permission denied)
- Explanation of
- On Governance and Innovation | 2022 OpenAtom Global Open Source Summit OpenAnolis sub-forum was successfully held
- 微信小程序使用云函数更新和添加云数据库嵌套数组元素
- 开源汇智创未来 | 2022开放原子全球开源峰会OpenAtom openEuler分论坛圆满召开
- Centos7 install mysql5.7 steps (graphical version)
猜你喜欢

Error EPERM operation not permitted, mkdir 'Dsoftwarenodejsnode_cache_cacach Two solutions

【C语言】操作符详解

VScode+ESP32快速安装ESP-IDF插件

开放原子开源基金会秘书长孙文龙 | 凝心聚力,共拓开源

Two address pools r2 are responsible for managing the address pool r1 is responsible for managing dhcp relays

Error EPERM operation not permitted, mkdir ‘Dsoftwarenodejsnode_cache_cacach两种解决办法

Unity打灵狐者

Industry-university-research application to build an open source talent ecosystem | 2022 Open Atom Global Open Source Summit Education Sub-Forum was successfully held
![Unity Tutorial: URP Rendering Pipeline Practical Tutorial Series [1]](/img/7c/c9ab32bbf43b933e5f84f0d142f7bd.jpg)
Unity Tutorial: URP Rendering Pipeline Practical Tutorial Series [1]

Unity教程:URP渲染管线实战教程系列【1】
随机推荐
Sql解析转换之JSqlParse完整介绍
ERROR 1819 (HY000) Your password does not satisfy the current policy requirements
MySQL fuzzy query can use INSTR instead of LIKE
MySQL optimization slow log query
城市内涝及桥洞隧道积水在线监测系统
MySQL optimization: from ten seconds to three hundred milliseconds
【云原生】DevOps(五):集成Harbor
Unity Fighter
Error EPERM operation not permitted, mkdir ‘Dsoftwarenodejsnode_cache_cacach两种解决办法
unity2d game
MySQL模糊查询可以使用INSTR替代LIKE
On Governance and Innovation | 2022 OpenAtom Global Open Source Summit OpenAnolis sub-forum was successfully held
DVWA之SQL注入
Interview | Cheng Li, CTO of Alibaba: Cloud + open source together form a credible foundation for the digital world
MySQL数据库必会的增删查改操作(CRUD)
MySQL database installation (detailed)
open failed: EACCES (Permission denied)
VScode+ESP32快速安装ESP-IDF插件
MySQL开窗函数
MySQL忘记密码怎么办