From f1ded8c26ac0c62e44c44e48de3ffb6784e4526c Mon Sep 17 00:00:00 2001 From: gfyoung Date: Tue, 26 Jul 2016 04:52:54 -0400 Subject: [PATCH] TST: Add test for skipfooter + decimal in read_csv --- pandas/io/tests/parser/python_parser_only.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/pandas/io/tests/parser/python_parser_only.py b/pandas/io/tests/parser/python_parser_only.py index 6f0ea75c4da93..0408401672a2f 100644 --- a/pandas/io/tests/parser/python_parser_only.py +++ b/pandas/io/tests/parser/python_parser_only.py @@ -185,3 +185,19 @@ def test_temporary_file(self): result = self.read_csv(new_file, sep=r"\s*", header=None) expected = DataFrame([[0, 0]]) tm.assert_frame_equal(result, expected) + + def test_skipfooter_with_decimal(self): + # see gh-6971 + data = '1#2\n3#4' + expected = DataFrame({'a': [1.2, 3.4]}) + + result = self.read_csv(StringIO(data), names=['a'], + decimal='#') + tm.assert_frame_equal(result, expected) + + # the stray footer line should not mess with the + # casting of the first t wo lines if we skip it + data = data + '\nFooter' + result = self.read_csv(StringIO(data), names=['a'], + decimal='#', skipfooter=1) + tm.assert_frame_equal(result, expected)