Skip to content

Instantly share code, notes, and snippets.

View syoh's full-sized avatar

Sang-Yun Oh syoh

  • University of California, Santa Barbara
  • Santa Barbara, CA, USA
View GitHub Profile
@syoh
syoh / control_print_precision.py
Created April 27, 2015 05:24
Control screen output precision
import numpy as np
import contextlib
@contextlib.contextmanager
def printoptions(*args, **kwargs):
original = np.get_printoptions()
np.set_printoptions(*args, **kwargs)
yield
np.set_printoptions(**original)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.