w10schools
Login Register
  • Home
  • Tutorials
    • HTML, CSS
      • HTML, HTML5
      • CSS, CSS3
    • XML
    • JavaScript, AJAX
    • PHP
    • Ruby on Rails
      • Ruby
      • Rails
    • ASP.NET
      • ASP
      • C# .NET
    • Java
      • JSP
    • Databases
      • MySQL
      • MSSQL Server
      • Oracle
    • Web Server
      • Windows
      • Linux
      • Apache
      • IIS
    • Design
      • Dreamweaver
      • Flash
      • Photoshop
      • Fireworks
      • CorelDRAW
      • Illustrator
  • References
    • HTML
      • Bootstrap
    • CSS
      • CSS Selectors
      • Sass
    • JavaScript
    • Mobile Apps
      • Cordova
    • Ruby on Rails
      • Ruby
      • Rails
    • PHP
      • Function
      • Language
      • CodeIgniter
      • Phalcon
      • PHPUnit
      • Symfony
      • Drupal
      • Yii
      • Laravel
    • Perl
      • Perl
    • Python
      • Python
      • Django
      • NumPy
      • Pandas
      • scikit-image
      • scikit-learn
      • Statsmodels
      • Matplotlib
    • Lua
      • Lua
    • C, C++
      • C
      • C++
    • Server
      • Docker
      • Apache HTTP Server
      • Nginx
    • Database
      • PostgreSQL
    • Big Data
      • TensorFlow
    • Game Development
      • Phaser
      • LÖVE
  • Articles
    • News
    • General
      • Website Promotion
      • Online Advertising
      • Make Money Online
    • Editorials
    • Interviews
    • Web Roundups
  • Resources
    • Design
      • Fonts
      • Graphics
      • Vectors
      • Templates
      • UI (User Interface)
      • Brushes
      • Patterns, Backgrounds
      • Textures
    • Web Development
      • HTML, CSS
      • XML
      • JavaScript, AJAX
      • Ruby on Rails
      • PHP
      • Java
      • .NET
      • Python
      • Perl
      • Flash
    • Mobile Application Development
      • Mobile Development Tools
      • Swift
    • Online Services
      • Online Storage
      • Web Hosting
  • Tools
    • Generators
Edit
In Place Editing Advanced Editing
  • References
  • Python
  • NumPy
  • Routines
  • Mathematical functions

numpy.rint()

numpy.rint(x[, out]) =

Round elements of the array to the nearest integer.

Parameters:

x : array_like

Input array.

Returns:

out : ndarray or scalar

Output array is same shape and type as x.

See also

ceil, floor, trunc

Examples

>>> a = np.array([-1.7, -1.5, -0.2, 0.2, 1.5, 1.7, 2.0])
>>> np.rint(a)
array([-2., -2., -0.,  0.,  2.,  2.,  2.])
Links:
  • https://docs.scipy.org/doc/numpy-1.11.0/reference/generated/numpy.rint.html
doc_NumPy
doc_NumPy
2025-01-10 15:47:30
Comments
Leave a Comment

Please login to continue.

Popular Articles
rint Defined in header <math.h> float rintf( float arg ); (1) (since C99) double rint( double arg ); (2) (since C99) long double
std::rint Defined in header <cmath> float rint( float arg ); (1) (since C++11) double rint( double arg ); (2) (since C++11) long doub
numpy.nanargmin() numpy.nanargmin(a, axis=None) [source] Return the indices of the minimum values in the specified axis ignoring NaNs. For all-NaN slices ValueErro
numpy.trunc() numpy.trunc(x[, out]) = Return the truncated value of the input, element-wise. The truncated value of the scalar x is the nearest integer i whic
numpy.argmax() numpy.argmax(a, axis=None, out=None) [source] Returns the indices of the maximum values along an axis. Parameters: a : array_like Input array.


Return to View
  • Facebook
  • Tweet
  • Digg it
  • Stumbleupon
  • Delicious
  • Plus Share

Designed by : w10schools

service@w10schools.com

Our Partners: aeeble – Providing content publishing and search solutions