Skip to content

TST: remove some warnings #17638

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 23, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pandas/core/reshape/reshape.py
Original file line number Diff line number Diff line change
Expand Up @@ -851,7 +851,7 @@ def lreshape(data, groups, dropna=True, label=None):
return DataFrame(mdata, columns=id_cols + pivot_cols)


def wide_to_long(df, stubnames, i, j, sep="", suffix='\d+'):
def wide_to_long(df, stubnames, i, j, sep="", suffix=r'\d+'):
r"""
Wide panel to long format. Less flexible but more user-friendly than melt.

Expand Down
2 changes: 1 addition & 1 deletion pandas/plotting/_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -2726,7 +2726,7 @@ def barh(self, x=None, y=None, **kwds):
return self(kind='barh', x=x, y=y, **kwds)

def box(self, by=None, **kwds):
"""
r"""
Boxplot

.. versionadded:: 0.17.0
Expand Down
6 changes: 6 additions & 0 deletions pandas/tests/frame/test_operators.py
Original file line number Diff line number Diff line change
Expand Up @@ -1035,6 +1035,12 @@ def test_boolean_comparison(self):
result = df == tup
assert_frame_equal(result, expected)

def test_boolean_comparison_error(self):

# GH 4576
# boolean comparisons with a tuple/list give unexpected results
df = DataFrame(np.arange(6).reshape((3, 2)))

# not shape compatible
pytest.raises(ValueError, lambda: df == (2, 2))
pytest.raises(ValueError, lambda: df == [2, 2])
Expand Down
2 changes: 1 addition & 1 deletion pandas/tests/indexes/test_interval.py
Original file line number Diff line number Diff line change
Expand Up @@ -1068,7 +1068,7 @@ def test_errors(self):
interval_range(start='foo', periods=10)

# invalid end
msg = 'end must be numeric or datetime-like, got \(0, 1\]'
msg = r'end must be numeric or datetime-like, got \(0, 1\]'
with tm.assert_raises_regex(ValueError, msg):
interval_range(end=Interval(0, 1), periods=10)

Expand Down
8 changes: 5 additions & 3 deletions pandas/tests/io/test_stata.py
Original file line number Diff line number Diff line change
Expand Up @@ -1053,7 +1053,8 @@ def test_iterator(self):
tm.assert_frame_equal(parsed.iloc[0:5, :], chunk)

# GH12153
from_chunks = pd.concat(read_stata(fname, chunksize=4))
with read_stata(fname, chunksize=4) as itr:
from_chunks = pd.concat(itr)
tm.assert_frame_equal(parsed, from_chunks)

def test_read_chunks_115(self):
Expand Down Expand Up @@ -1306,8 +1307,9 @@ def test_value_labels_iterator(self, write_index):
df['A'] = df['A'].astype('category')
with tm.ensure_clean() as path:
df.to_stata(path, write_index=write_index)
dta_iter = pd.read_stata(path, iterator=True)
value_labels = dta_iter.value_labels()

with pd.read_stata(path, iterator=True) as dta_iter:
value_labels = dta_iter.value_labels()
assert value_labels == {'A': {0: 'A', 1: 'B', 2: 'C', 3: 'E'}}

def test_set_index(self):
Expand Down