Skip to content

Commit f1ded8c

Browse files
committed
TST: Add test for skipfooter + decimal in read_csv
1 parent 98c5b88 commit f1ded8c

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

pandas/io/tests/parser/python_parser_only.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,3 +185,19 @@ def test_temporary_file(self):
185185
result = self.read_csv(new_file, sep=r"\s*", header=None)
186186
expected = DataFrame([[0, 0]])
187187
tm.assert_frame_equal(result, expected)
188+
189+
def test_skipfooter_with_decimal(self):
190+
# see gh-6971
191+
data = '1#2\n3#4'
192+
expected = DataFrame({'a': [1.2, 3.4]})
193+
194+
result = self.read_csv(StringIO(data), names=['a'],
195+
decimal='#')
196+
tm.assert_frame_equal(result, expected)
197+
198+
# the stray footer line should not mess with the
199+
# casting of the first t wo lines if we skip it
200+
data = data + '\nFooter'
201+
result = self.read_csv(StringIO(data), names=['a'],
202+
decimal='#', skipfooter=1)
203+
tm.assert_frame_equal(result, expected)

0 commit comments

Comments
 (0)