Skip to content

Commit 431e10a

Browse files
committed
float precision...
1 parent d7d1e9f commit 431e10a

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

pandas/io/tests/parser/c_parser_only.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,9 @@
1212

1313
import pandas as pd
1414
import pandas.util.testing as tm
15-
from pandas import DataFrame, Series, Index, MultiIndex, Categorical
15+
from pandas import DataFrame
1616
from pandas import compat
1717
from pandas.compat import StringIO, range, lrange
18-
from pandas.types.dtypes import CategoricalDtype
1918

2019

2120
class CParserTests(object):

pandas/io/tests/parser/dtypes.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@ def test_passing_dtype(self):
2121
'AB'), index=['1A', '1B', '1C', '1D', '1E'])
2222

2323
with tm.ensure_clean('__passing_str_as_dtype__.csv') as path:
24-
df.to_csv(path)
24+
df.to_csv(path, float_format='%.12f')
2525

2626
# see gh-3795: passing 'str' as the dtype
2727
result = self.read_csv(path, dtype=str, index_col=0)
28-
expected = df.astype(str)
28+
expected = df.applymap(lambda x: '%.12f' % (x,))
2929
tm.assert_frame_equal(result, expected)
3030

3131
# for parsing, interpret object as str

0 commit comments

Comments
 (0)