pydata/pandas — Issue #872: DataFrame.to_string() does not always use formatters argument
Author: lodagro
Created: 2012-03-06 16:02:05+00:00
State: open

```python
In [28]: myformatter = lambda x: '[%4.1f]' % x

In [29]: df = pandas.DataFrame(np.random.randn(2,2), columns=['A', 'B'])

In [30]: df
Out[30]:
A B
0 -0.478634 1.143561
1 0.043301 1.006389

In [31]: print df.to_string(formatters={'A': myformatter})
A B
0 [-0.5] 1.143561
1 [ 0.0] 1.006389

In [32]: df = pandas.DataFrame(np.random.randint(0, 10, (2, 2)), columns=['A', 'B'])

In [33]: df
Out[33]:
A B
0 4 3
1 0 4

In [34]: print df.to_string(formatters={'A': myformatter})
A B
0 4 3
1 0 4

In [35]:

```