NumPy Input and Output: printoptions() function
numpy.printoptions() function
The printoption() function is a context manager for setting print options.
Set print options for the scope of the with block, and restore the old options at the end.
Syntax:
numpy.printoptions(*args, **kwargs)
Version: 1.15.0
NumPy.printoptions() method Example:
>>> import numpy as np
>>> with np.printoptions(precision=3):
... print(np.array([3.0/4]))
Output:
[0.75]
The as-clause of the with-statement gives the current print options:
>>> with np.printoptions(precision=2) as opts:
... assert_equal(opts, np.get_printoptions())
Python - NumPy Code Editor:
Previous: set_string_function()
Next: binary_repr() function
- Weekly Trends
- Python Interview Questions and Answers: Comprehensive Guide
- Scala Exercises, Practice, Solution
- Kotlin Exercises practice with solution
- MongoDB Exercises, Practice, Solution
- SQL Exercises, Practice, Solution - JOINS
- Java Basic Programming Exercises
- SQL Subqueries
- Adventureworks Database Exercises
- C# Sharp Basic Exercises
- SQL COUNT() with distinct
- JavaScript String Exercises
- JavaScript HTML Form Validation
- Java Collection Exercises
- SQL COUNT() function
- SQL Inner Join
We are closing our Disqus commenting system for some maintenanace issues. You may write to us at reach[at]yahoo[dot]com or visit us at Facebook