当前位置:网站首页>The round functions in the np, ceil function and floor function
The round functions in the np, ceil function and floor function
2022-08-09 23:11:00 【phac123】
np.round()
import numpy as np
x = [10.7, 10.5, 10.3, 11.7, 11.5, 11.3, 0.7, 0.5, 0.3]
y = np.round(x)
print(y)
- np.round()The meaning of function is round.In the theory of error,Even when the integer part of,小数部分是0.5时,向下取整;When the integer part is odd,小数部分是0.5时,则向上取整.也就是说,When the decimal part is0.5的时候,“Go odd save even”,Such results are statistically more accurate.numpy的roundFunction using that method was.
np.ceil()*
import numpy as np
x = [10.7, 10.5, 10.3, 11.7, 11.5, 11.3, 0.7, 0.5, 0.3]
y = np.ceil(x)
print(y)
- 向上取整
np.floor()
import numpy as np
x = [10.7, 10.5, 10.3, 11.7, 11.5, 11.3, 0.7, 0.5, 0.3]
y = np.floor(x)
print(y)
- 向下取整
边栏推荐
- 基于Docker构建MySQL主从复制数据库
- Puyuan Jingdian turned losses into profits in the first half of the year, and high-end products continued to develop!Are you optimistic about "Huawei" in the instrument industry?
- 简单问题窥见数学
- STC8H Development (15): GPIO Drives Ci24R1 Wireless Module
- [corctf 2022] section
- TF生成均匀分布的tensor
- 威纶通触摸屏制作自定义弹出窗口的具体方法(3种)
- SQL语句及索引的优化
- Optimization of SQL Statements and Indexes
- RHEL7系统修复rm -rf /boot /etc/fstab
猜你喜欢
6个规则去净化你的代码

APP automation test framework - UiAutomator2 introductory

论文解读(DropEdge)《DropEdge: Towards Deep Graph Convolutional Networks on Node Classification》

Don't tell me to play, I'm taking the PMP exam: what you need to know about choosing an institution for the PMP exam

【双链表增删查改接口的实现】

DSPE-PEG-Silane, DSPE-PEG-SIL, phospholipid-polyethylene glycol-silane modified silica particles

蓝牙模块有哪些种类?BLE低功耗蓝牙模块有什么特点?

消防安全培训|“蓝朋友”,开课了!

Bean生命周期

Unity2D_背景粒子效果
随机推荐
【双链表增删查改接口的实现】
6 g underwater channel modeling were summarized based on optical communication
Word文档怎么输入无穷大符号∞
抽象类 or 接口
普源精电上半年扭亏为盈,高端产品持续发力!你看好仪器界“华为”吗?
Deceptive Dice(期望计算)
Access control knowledge
单元测试
Word第一页不要页眉怎么设置?设置Word首页不要页眉方法教程
Application of Acrel5000web Energy Consumption System in a College-Susie Week
mysql配置参数详解[通俗易懂]
别叫我玩,我要考PMP:考PMP选择机构需要了解的那些事儿
AI Knows Everything: Building and Deploying a Sign Language Recognition System from Zero
gmail+mtalk配合打免费网络电话。
在VMware上安装win虚拟机
题解:Edu Codeforces 109(div2)
上海控安SmartRocket系列产品推介(三):SmartRocket iVerifier计算机联锁系统验证工具
PMP daily practice | didn't lost a 8.9 (including agile + multi-select)
C语言预处理命令是什么?
cadence中复制一部分PCB到另一个PCB中去


