numpy.floor

2023-05-16

numpy.floor(x, /, out=None, *, where=True, casting='same_kind', order='K', dtype=None, subok=True[, signature, extobj]) = <ufunc 'floor'>

按照元素的方式返回输入的下限。

标量x的底部是最大的整数i,使得i <= x。 它通常表示为\ lfloor x \ rfloor。

Parameters:

x : array_like
Input data.
out : ndarray, None, or tuple of ndarray and None, optional
A location into which the result is stored. If provided, it must have a shape that the inputs broadcast to. If not provided or None, a freshly-allocated array is returned. A tuple (possible only as a keyword argument) must have length equal to the number of outputs.
where : array_like, optional
Values of True indicate to calculate the ufunc at that position, values of False indicate to leave the value in the output alone.
**kwargs
For other keyword-only arguments, see the ufunc docs.
Returns:
y : ndarray or scalar

The floor of each element in x.

Notes

一些电子表格程序计算“floor-to-zero”,换一种说法 floor(-2.5) == -2.
NumPy instead uses the definition of floor where floor(-2.5) == -3.

Examples

In [2]: import numpy as np

In [3]: a = np.array([-1.7, -1.5, -0.2, 0.2, 1.5, 1.7, 2.0])

In [4]: np.floor(a)
Out[4]: array([-2., -2., -1.,  0.,  1.,  1.,  2.])
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

numpy.floor 的相关文章

随机推荐

  • Linux服务器上监控网络带宽的18个常用命令

    本文介绍了一些可以用来监控网络使用情况的Linux命令行工具 这些工具可以监控通过网络接口传输的数据 xff0c 并测量目前哪些数据所传输的速度 入站流量和出站流量分开来显示 一些命令可以显示单个进程所使用的带宽 这样一来 xff0c 用户
  • Linux系统使用iftop查看带宽占用情况

    Linux系统下如果服务器带宽跑满了 xff0c 查看跟哪个ip通信占用带宽比较多 xff0c 可以通过iftop命令进行查询 xff0c 使用方法如下 xff1a 1 安装方法 软件官网地址 xff1a http www ex parro
  • linux基础命令

    1 curl amp wget 使用curl或wget命令 xff0c 不用离开终端就可以下载文件 如你用curl xff0c 键入curl O后面跟一个文件路径 wget则不需要任何选项 下载的文件在当前目录 代码如下 curl O we
  • find_in_set

    1 in查询相当于多个or条件的叠加 xff0c 例如 xff1a select from user where user id in 1 2 3 等效于 select from user where user id 61 1 or use
  • 集成Cortex-M0内核-- Integration and Implementation Manual手册学习

    根据使用场景 xff0c 配置并集成一个Cortex M0的内核 xff0c 暂时不涉及的实现的部分 目录 阅读手册 Chapter1 Introduction 1 1 About the processor 1 2 About integ
  • 在NVIDIA NX 配置OpenCV多版本冲突和解决的总结

    Nvidia Jetson NX 环境 直接刷JetPack5 1的镜像 xff0c 会得到如下环境 Ubuntu20 04cuda11 4TensorRT8 4cudnn8 4opencv4 5 4 而且这些源一般是从nv xxxx等源下
  • 一款入门级的飞控CC3D(一)

    很多在校的朋友想自己动手做一款旋翼无人机 xff0c 但是零件采购下来要花费不少大洋 xff0c 装配完成后又需要进行软件硬件调试 所以很多想做极客的梦就扼杀在摇篮里 本期我将开始更新一款入门级的飞控CC3D 首先 xff0c 放上CC3D
  • 朱刘算法(Directed Minimum Spanning Tree/Directed MST/Minimum Arborescence/Optimum Branchings)

    概念 最小树形图 xff1a 有向图所分离出的有向生成树 亦称为最小树形图 xff0c 其应满足以下条件 xff1a 1 恰好有一个入度为0的点 xff0c 称为根结点 2 其他结点的入度均为1 3 可以从根结点到达其他结点 既然要找最小生
  • 仿真复现文章推荐

    以下学长推荐的文章 xff1a 人脸识别 xff1a SphereFace Deep Hypersphere Embedding for Face Recognition 手势姿态 xff1a OpenPose 3D人脸建模 xff1a L
  • 查看GPU显存 使用率

    watch n 0 2 nvidia smi 主要关注GPU Util Memory Usage 0 2表示每隔0 2秒刷新一次终端的显示结果 上面的表格中 xff1a 第一栏的Fan xff1a N A是风扇转速 xff0c 从0到100
  • scipy.ndimage.zoom

    最近邻 选择离它所映射到的位置最近的输入像素的灰度值为插值结果 最临近插值 3X3 的256级灰度图 xff0c 也就是高为3个象素 xff0c 宽也是3个象素的图像 xff0c 每个象素的取值可以是 0 xff0d 255 xff0c 代
  • torch.manual_seed()

    torch manual seed args seed 为CPU设置种子用于生成随机数 xff0c 以使得结果是确定的 if args cuda torch cuda manual seed args seed 为当前GPU设置随机种子 x
  • python torch.optim.SGD

    torch optim sgd学习参数 torch入门笔记14 Torch中optim的sgd Stochastic gradient descent 方法的实现细节 pytorch中使用torch optim优化神经网络以及优化器的选择
  • python zero_grad()

    有两种方式直接把模型的参数梯度设成0 xff1a model span class hljs preprocessor zero span grad optimizer span class hljs preprocessor zero s
  • torch.topk

    torch kthvalue input k dim 61 None keepdim 61 False out 61 None gt Tensor LongTensor k xff1a 第k个最小元素 返回第k个最小元素 input k d
  • torch.normal()

    torch normal means std out 61 None 返回一个张量 xff0c 包含从给定参数means std的离散正态分布中抽取随机数 均值means是一个张量 xff0c 包含每个输出元素相关的正态分布的均值 std是
  • 台式机ubuntu18.04 x86_64 简单ROS版本安装及其他库编译

    本教程是用于只安装ros melodic ros base的情况下 xff0c 为了避免安装opencv3 2 xff0c 而只保留一个opencv3 4 10 xff0c 而一步步安装rqt xff0c cv bridge xff0c r
  • ubuntu 当前文件夹 文件个数

    ls l grep 34 34 wc l
  • python [:,::-1]

    In span class hljs number 33 span t 61 np array span class hljs string 1 2 3 4 5 6 7 8 9 span In span class hljs number
  • numpy.floor

    numpy floor x out 61 None where 61 True casting 61 39 same kind 39 order 61 39 K 39 dtype 61 None subok 61 True signatur