Skip to content

Instantly share code, notes, and snippets.

@jaantollander
Created March 15, 2017 14:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jaantollander/47b956ab64f98ac8a4ad3fa55f61dbed to your computer and use it in GitHub Desktop.
Save jaantollander/47b956ab64f98ac8a4ad3fa55f61dbed to your computer and use it in GitHub Desktop.
Setup string formatting of numpy arrays
def format_numpy(precision=5, threshold=6, edgeitems=3, linewidth=None,
suppress=False, nanstr=None, infstr=None, formatter=None):
try:
import numpy as np
np.set_printoptions(precision, threshold, edgeitems, linewidth,
suppress, nanstr, infstr, formatter)
except ImportError:
return
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment