Skip to content

Commit

Permalink
TST: Add test for skipfooter + decimal in read_csv
Browse files Browse the repository at this point in the history
  • Loading branch information
gfyoung committed Jul 26, 2016
1 parent 98c5b88 commit f1ded8c
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions pandas/io/tests/parser/python_parser_only.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

0 comments on commit f1ded8c

Please sign in to comment.