当前位置:网站首页>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模糊查询可以使用INSTR替代LIKE
- unity2d game
- sql statement - how to query data in another table based on the data in one table
- The input input box displays the precision of two decimal places
- MySQL常见面试题汇总(建议收藏!!!)
- MySQL优化:从十几秒优化到三百毫秒
- VScode+ESP32快速安装ESP-IDF插件
- STM32HAL库修改Hal_Delay为us级延时
- MySQL database installation (detailed)
猜你喜欢

Solved (the latest version of selenium framework element positioning error) NameError: name 'By' is not defined

HCIP第十天_BGP路由汇总实验

Open Source Smart Future | 2022 OpenAtom Global Open Source Summit OpenAtom openEuler sub-forum was successfully held

两个地址池r2负责管地址池r1负责管dhcp中继

三道leetcode上的oj题

ERROR 1819 (HY000) Your password does not satisfy the current policy requirements

MySQL transaction (transaction) (this is enough..)

重磅 | 开放原子校源行活动正式启动

ERROR 2003 (HY000) Can‘t connect to MySQL server on ‘localhost3306‘ (10061)

HCIP Day 10_BGP Route Summary Experiment
随机推荐
SOLVED: After accidentally uninstalling pip (two ways to manually install pip)
Puzzle Game Level Design: Reverse Method--Explaining Puzzle Game Level Design
【wpf】wpf中的那些模板之深度解析
【py脚本】批量二值化处理图像
mysql使用on duplicate key update批量更新数据
open failed: EACCES (Permission denied)
mysql数据库安装(详细)
sql语句-如何以一个表中的数据为条件据查询另一个表中的数据
MySQL开窗函数
[C language] Detailed explanation of operators
[R language] [3] apply, tapply, lapply, sapply, mapply and par function related parameters
DVWA靶场环境搭建
centos7安装mysql5.7
ERROR 1819 (HY000) Your password does not satisfy the current policy requirements
DVWA安装教程(懂你的不懂·详细)
DVWA shooting range environment construction
【C语言】操作符详解
ENSP,划分VLAN、静态路由,三层交换机综合配置
SQL statement to range query time field
CentOS7 安装MySQL 图文详细教程