Skip to content
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

TST: remove some deprecation warnings #17870

Merged
merged 1 commit into from
Oct 14, 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
5 changes: 4 additions & 1 deletion pandas/io/html.py
Original file line number Diff line number Diff line change
Expand Up @@ -759,7 +759,7 @@ def _parse(flavor, io, match, attrs, encoding, **kwargs):

def read_html(io, match='.+', flavor=None, header=None, index_col=None,
skiprows=None, attrs=None, parse_dates=False,
tupleize_cols=False, thousands=',', encoding=None,
tupleize_cols=None, thousands=',', encoding=None,
decimal='.', converters=None, na_values=None,
keep_default_na=True):
r"""Read HTML tables into a ``list`` of ``DataFrame`` objects.
Expand Down Expand Up @@ -828,6 +828,9 @@ def read_html(io, match='.+', flavor=None, header=None, index_col=None,
:class:`~pandas.MultiIndex`, otherwise return raw tuples. Defaults to
``False``.

.. deprecated:: 0.21.0
This argument will be removed and will always convert to MultiIndex

thousands : str, optional
Separator to use to parse thousands. Defaults to ``','``.

Expand Down
2 changes: 1 addition & 1 deletion pandas/tests/indexes/test_multi.py
Original file line number Diff line number Diff line change
Expand Up @@ -458,7 +458,7 @@ def test_set_value_keeps_names(self):
df = df.sort_index()
assert df.is_copy is None
assert df.index.names == ('Name', 'Number')
df = df.set_value(('grethe', '4'), 'one', 99.34)
df.at[('grethe', '4'), 'one'] = 99.34
assert df.is_copy is None
assert df.index.names == ('Name', 'Number')

Expand Down
2 changes: 1 addition & 1 deletion pandas/tests/plotting/test_frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -2835,7 +2835,7 @@ def test_plain_axes(self):
Series(rand(10)).plot(ax=cax)

fig, ax = self.plt.subplots()
from mpl_toolkits.axes_grid.inset_locator import inset_axes
from mpl_toolkits.axes_grid1.inset_locator import inset_axes
iax = inset_axes(ax, width="30%", height=1., loc=3)
Series(rand(10)).plot(ax=ax)
Series(rand(10)).plot(ax=iax)
Expand Down
1 change: 0 additions & 1 deletion pandas/tests/plotting/test_misc.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,6 @@ def test_parallel_coordinates(self):
def test_parallel_coordinates_with_sorted_labels(self):
""" For #15908 """
from pandas.plotting import parallel_coordinates

df = DataFrame({"feat": [i for i in range(30)],
"class": [2 for _ in range(10)] +
[3 for _ in range(10)] +
Expand Down
12 changes: 6 additions & 6 deletions pandas/tests/reshape/test_merge.py
Original file line number Diff line number Diff line change
Expand Up @@ -1546,6 +1546,7 @@ def test_dtype_on_categorical_dates(self):
result_inner = pd.merge(df, df2, how='inner', on=['date'])
assert_frame_equal(result_inner, expected_inner)

@pytest.mark.parametrize('ordered', [True, False])
@pytest.mark.parametrize('category_column,categories,expected_categories',
[([False, True, True, False], [True, False],
[True, False]),
Expand All @@ -1554,20 +1555,19 @@ def test_dtype_on_categorical_dates(self):
['True', 'False'], ['True', 'False'])])
def test_merging_with_bool_or_int_cateorical_column(self, category_column,
categories,
expected_categories):
expected_categories,
ordered):
# GH 17187
# merging with a boolean/int categorical column
df1 = pd.DataFrame({'id': [1, 2, 3, 4],
'cat': category_column})
df1['cat'] = df1['cat'].astype('category',
categories=categories, ordered=True)
df1['cat'] = df1['cat'].astype(CDT(categories, ordered=ordered))
df2 = pd.DataFrame({'id': [2, 4], 'num': [1, 9]})
result = df1.merge(df2)
expected = pd.DataFrame({'id': [2, 4], 'cat': expected_categories,
'num': [1, 9]})
expected['cat'] = expected['cat'].astype('category',
categories=categories,
ordered=True)
expected['cat'] = expected['cat'].astype(
CDT(categories, ordered=ordered))
assert_frame_equal(expected, result)


Expand Down
6 changes: 3 additions & 3 deletions pandas/tests/test_categorical.py
Original file line number Diff line number Diff line change
Expand Up @@ -3592,7 +3592,7 @@ def test_slicing_and_getting_ops(self):
tm.assert_frame_equal(res_fancy, exp_fancy)

# get_value
res_val = df.get_value("j", "cats")
res_val = df.at["j", "cats"]
assert res_val == exp_val

# i : int, slice, or sequence of integers
Expand Down Expand Up @@ -3956,12 +3956,12 @@ def f():

# set_value
df = orig.copy()
df.set_value("j", "cats", "b")
df.at["j", "cats"] = "b"
tm.assert_frame_equal(df, exp_single_cats_value)

def f():
df = orig.copy()
df.set_value("j", "cats", "c")
df.at["j", "cats"] = "c"

pytest.raises(ValueError, f)

Expand Down
12 changes: 6 additions & 6 deletions pandas/tests/test_panel.py
Original file line number Diff line number Diff line change
Expand Up @@ -1451,14 +1451,14 @@ def test_reindex_axis_style(self):
expected1 = Panel(panel.values).iloc[:, [0, 1]]
expected2 = Panel(panel.values).iloc[:, :, [0, 1]]

result = panel.reindex([0, 1], axis=0)
assert_panel_equal(result, expected0)
result = panel.reindex([0, 1], axis=0)
assert_panel_equal(result, expected0)

result = panel.reindex([0, 1], axis=1)
assert_panel_equal(result, expected1)
result = panel.reindex([0, 1], axis=1)
assert_panel_equal(result, expected1)

result = panel.reindex([0, 1], axis=2)
assert_panel_equal(result, expected2)
result = panel.reindex([0, 1], axis=2)
assert_panel_equal(result, expected2)

def test_reindex_multi(self):
with catch_warnings(record=True):
Expand Down
4 changes: 2 additions & 2 deletions pandas/tests/test_panel4d.py
Original file line number Diff line number Diff line change
Expand Up @@ -563,8 +563,8 @@ def test_get_value(self):
for item in self.panel4d.items:
for mjr in self.panel4d.major_axis[::2]:
for mnr in self.panel4d.minor_axis:
result = self.panel4d.get_value(
label, item, mjr, mnr)
result = self.panel4d.loc[
label, item, mjr, mnr]
expected = self.panel4d[label][item][mnr][mjr]
assert_almost_equal(result, expected)

Expand Down