This is a pre-release version (latest).Go to latest (2.4.4)
{ } Raw JSON

bundles / numpy latest / numpy / get_printoptions

function

numpy:get_printoptions

source: /dev/numpy/build-install/usr/lib/python3.14/site-packages/numpy/_core/arrayprint.py:332

Signature

def get_printoptions()

Summary

Return the current print options.

Returns

print_opts : dict

Dictionary of current print options with keys

  • precisionint

  • thresholdint

  • edgeitemsint

  • linewidthint

  • suppressbool

  • nanstrstr

  • infstrstr

  • signstr

  • formatterdict of callables

  • floatmodestr

  • legacystr or False

For a full description of these options, see set_printoptions.

Notes

These print options apply only to NumPy ndarrays, not to scalars.

Examples

import numpy as np
✓
np.get_printoptions()
✓
{'edgeitems': 3, 'threshold': 1000, 'floatmode': 'maxprec', 'precision': 8, 'suppress': False, 'linewidth': 75, 'nanstr': 'nan', 'infstr': 'inf', 'sign': '-', 'formatter': None, 'legacy': False, 'override_repr': None}
np.get_printoptions()['linewidth']
np.set_printoptions(linewidth=100)
np.get_printoptions()['linewidth']
✓
100

See also

printoptions
set_printoptions

Aliases

  • numpy.get_printoptions