pandas-dev / pandas

Flexible and powerful data analysis / manipulation library for Python, providing labeled data structures similar to R data.frame objects, statistical functions, and much more
https://pandas.pydata.org
BSD 3-Clause "New" or "Revised" License
43.18k stars 17.77k forks source link

Add suppress option to pd.set_option #2735

Closed sglyon closed 11 years ago

sglyon commented 11 years ago

I do computational physics and economics and often generate data that is very close to zero (on the order of 1e-14 to 1e-16). When printing out a numpy array I often use the command

import numpy as np

np.set_printoptions(suppress=True)

This will cause items close to zero to be displayed as zero.

I think this would be a very simple addition to pandas.set_option. I'll try to work on it, but someone else who already knows the format of extending pandas.set_option will be able to get it done much more quickly.

ghost commented 11 years ago

easy enough. Please test the PR and see if it works for you.

sglyon commented 11 years ago

Works great. Thanks.