Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 5848b4e

Browse files
authored
Merge pull request #26488 from luxedo/add-get_printoptions-example
DOC: add examples to get_printoptions
2 parents 27b52f6 + c11d7ef commit 5848b4e

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

numpy/_core/arrayprint.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -329,6 +329,18 @@ def get_printoptions():
329329
--------
330330
set_printoptions, printoptions
331331
332+
Examples
333+
--------
334+
335+
>>> np.get_printoptions()
336+
{'edgeitems': 3, 'threshold': 1000, ..., 'legacy': False}
337+
338+
>>> np.get_printoptions()['linewidth']
339+
75
340+
>>> np.set_printoptions(linewidth=100)
341+
>>> np.get_printoptions()['linewidth']
342+
100
343+
332344
"""
333345
opts = _format_options.copy()
334346
opts['legacy'] = {

0 commit comments

Comments
 (0)