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)