当前位置:网站首页>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)
- 向下取整
边栏推荐
- 微软word怎么转换成pdf文件?微软word转换为pdf格式的方法
- 字符串哈希(2014 SERC J题)
- 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?
- 场效应管Mosfet之雷卯Leiditech对应英飞凌Infineon
- LoRa无线技术在物联网应用市场的概况和发展
- mysql配置参数详解[通俗易懂]
- CVPR22 Oral|通过多尺度token聚合分流自注意力,代码已开源
- L3-2 至多删三个字符 (30 分)
- 万字总结:分布式系统的38个知识点
- Number of daffodils within a thousand
猜你喜欢
SQLi-LABS Page-2 (Adv Injections)
蓝牙模块有哪些种类?BLE低功耗蓝牙模块有什么特点?
STC8H开发(十五): GPIO驱动Ci24R1无线模块
AI Knows Everything: Building and Deploying a Sign Language Recognition System from Zero
6个规则去净化你的代码
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?
[corctf 2022] section
What to do if Windows 11 can't find Internet Explorer
Unity2D_背景粒子效果
10个 Istio 流量管理 最常用的例子,你知道几个?
随机推荐
Don't use array.length-1 to get the last item of the array
Unity_物体自转
在VMware上安装win虚拟机
Word文档怎么输入无穷大符号∞
np中的round函数,ceil函数与floor函数
Word怎么制作一张标准的答题卡?
Definition and Basic Operations of Sequence Tables
别叫我玩,我要考PMP:考PMP选择机构需要了解的那些事儿
linux定时执行sql文件[通俗易懂]
Word怎么设置图片衬于文字下方?两种方法教你设置Word图片衬于文字下方
FS4066耐高压1到4节内置MOS的锂电池充电管理芯片
Unity2D_线框材质
Word箭头上面怎么打字
简单问题窥见数学
蓝牙模块的分类和对应的属性特点
【云原生】4.2 DevOps 精讲篇
supervisor 命令操作大全「建议收藏」
【stack】【queue】【priority_queue】【deque】详解
QGIS编译SIP的问题
STC8H开发(十五): GPIO驱动Ci24R1无线模块