Skip to content

Commit a46609a

Browse files
committed
Corrected test modification
1 parent 8db5247 commit a46609a

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

pandas/tests/plotting/test_groupby.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ def test_groupby_hist_with_legend(self, column, expected_axes_num, label):
7575
expected_layout = (1, expected_axes_num)
7676
expected_labels = label or column or [["a"], ["b"]]
7777

78-
index = Index(15 * [1] + 15 * [2], name="c")
78+
index = Index(15 * ["1"] + 15 * ["2"], name="c")
7979
df = DataFrame(np.random.randn(30, 2), index=index, columns=["a", "b"])
8080
g = df.groupby("c")
8181

@@ -99,10 +99,8 @@ def test_groupby_hist_with_legend(self, column, expected_axes_num, label):
9999
def test_groupby_hist_series_with_legend(self, label, expected_label):
100100
# GH 6279
101101
# Histogram can have a legend
102-
index = Index(15 * [1] + 15 * [2], name="c")
102+
index = Index(15 * ["1"] + 15 * ["2"], name="c")
103103
df = DataFrame(np.random.randn(30, 2), index=index, columns=["a", "b"])
104-
# older version of matplotlib fails if labels are not strings
105-
df = df.astype(str)
106104
g = df.groupby("c")
107105

108106
kwargs = {"legend": True}

pandas/tests/plotting/test_hist_method.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ def test_hist_with_legend(
138138
):
139139
# GH 6279
140140
# Histogram can have a legend
141-
index = 15 * [1] + 15 * [2]
141+
index = 15 * ["1"] + 15 * ["2"]
142142
s = Series(np.random.randn(30), index=index, name="a")
143143
s.index.name = "b"
144144

@@ -327,7 +327,7 @@ def test_hist_with_legend(self, by, column, label):
327327
if by is not None:
328328
expected_labels = [expected_labels] * 2
329329

330-
index = Index(15 * [1] + 15 * [2], name="c")
330+
index = Index(15 * ["1"] + 15 * ["2"], name="c")
331331
df = DataFrame(np.random.randn(30, 2), index=index, columns=["a", "b"])
332332

333333
kwargs = {"legend": True, "by": by, "column": column}

0 commit comments

Comments
 (0)