Skip to content

Commit

Permalink
fix pytest error
Browse files Browse the repository at this point in the history
  • Loading branch information
charlesdong1991 committed Mar 31, 2019
1 parent b362ffa commit 374b1c7
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions pandas/tests/test_strings.py
Original file line number Diff line number Diff line change
Expand Up @@ -924,14 +924,14 @@ def test_replace(self):
tm.assert_almost_equal(rs, xp)

# unicode
values = Series([u('fooBAD__barBAD'), NA])
values = Series([u'fooBAD__barBAD', NA])

result = values.str.replace('BAD[_]*', '', regex=True)
exp = Series([u('foobar'), NA])
exp = Series([u'foobar', NA])
tm.assert_series_equal(result, exp)

result = values.str.replace('BAD[_]*', '', n=1, regex=True)
exp = Series([u('foobarBAD'), NA])
exp = Series([u'foobarBAD', NA])
tm.assert_series_equal(result, exp)

# flags + unicode
Expand Down Expand Up @@ -994,7 +994,7 @@ def test_replace_compiled_regex(self):
exp = Series(['foobar', NA])
tm.assert_series_equal(result, exp)

result = values.str.replace(pat, '', n=1)
result = values.str.replace(pat, '', n=1, regex=True)
exp = Series(['foobarBAD', NA])
tm.assert_series_equal(result, exp)

Expand All @@ -1008,14 +1008,14 @@ def test_replace_compiled_regex(self):
tm.assert_almost_equal(rs, xp)

# unicode
values = Series([u('fooBAD__barBAD'), NA])
values = Series([u'fooBAD__barBAD', NA])

result = values.str.replace(pat, '', regex=True)
exp = Series([u('foobar'), NA])
exp = Series([u'foobar', NA])
tm.assert_series_equal(result, exp)

result = values.str.replace(pat, '', n=1, regex=True)
exp = Series([u('foobarBAD'), NA])
exp = Series([u'foobarBAD', NA])
tm.assert_series_equal(result, exp)

# flags + unicode
Expand Down

0 comments on commit 374b1c7

Please sign in to comment.