Skip to content

Bug in 'chop.threshold' option #6839

Closed
@jseabold

Description

@jseabold

xref #6842

Columns where every value is below the threshold disappear. From ML.

In [78]: df.as_matrix()
Out[78]:
array([[  1.00000000e+01,   7.59062963e-10],
    [  2.00000000e+01,  -1.47734680e-11],
    [  3.00000000e+01,   2.18850713e-09],
    [  4.00000000e+01,  -1.86628720e-11]])

In [79]: np.set_printoptions(suppress=True)

In [80]: df.as_matrix()
Out[80]:
array([[ 10.,   0.],
    [ 20.,  -0.],
    [ 30.,   0.],
    [ 40.,  -0.]])


From the docstring, it appears that the 'chop_threshold' option can be
used to do the same thing (and with a threshold as a parameter), but
in this case, it does something weird (perhaps a bug?):

In [81]: pd.set_option('chop_threshold', 1e-8)

In [82]: df
Out[82]:
    0  1
0  10
1  20
2  30
3  40

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugOutput-Formatting__repr__ of pandas objects, to_stringTestingpandas testing functions or related to the test suite

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions