Skip to content

Commit 1a9964c

Browse files
committed
TST: Fix boxplot test for python3
1 parent 86ecb99 commit 1a9964c

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

pandas/tests/test_graphics.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2626,7 +2626,7 @@ class TestDataFrameGroupByPlots(TestPlotBase):
26262626
def test_boxplot(self):
26272627
grouped = self.hist_df.groupby(by='gender')
26282628
axes = _check_plot_works(grouped.boxplot, return_type='axes')
2629-
self._check_axes_shape(axes.values(), axes_num=2, layout=(1, 2))
2629+
self._check_axes_shape(list(axes.values()), axes_num=2, layout=(1, 2))
26302630

26312631
axes = _check_plot_works(grouped.boxplot, subplots=False,
26322632
return_type='axes')
@@ -2638,15 +2638,15 @@ def test_boxplot(self):
26382638

26392639
grouped = df.groupby(level=1)
26402640
axes = _check_plot_works(grouped.boxplot, return_type='axes')
2641-
self._check_axes_shape(axes.values(), axes_num=10, layout=(4, 3))
2641+
self._check_axes_shape(list(axes.values()), axes_num=10, layout=(4, 3))
26422642

26432643
axes = _check_plot_works(grouped.boxplot, subplots=False,
26442644
return_type='axes')
26452645
self._check_axes_shape(axes, axes_num=1, layout=(1, 1))
26462646

26472647
grouped = df.unstack(level=1).groupby(level=0, axis=1)
26482648
axes = _check_plot_works(grouped.boxplot, return_type='axes')
2649-
self._check_axes_shape(axes.values(), axes_num=3, layout=(2, 2))
2649+
self._check_axes_shape(list(axes.values()), axes_num=3, layout=(2, 2))
26502650

26512651
axes = _check_plot_works(grouped.boxplot, subplots=False,
26522652
return_type='axes')
@@ -2823,14 +2823,14 @@ def test_grouped_box_multiple_axes(self):
28232823
fig, axes = self.plt.subplots(2, 3)
28242824
returned = df.boxplot(column=['height', 'weight', 'category'], by='gender',
28252825
return_type='axes', ax=axes[0])
2826-
returned = np.array(returned.values())
2826+
returned = np.array(list(returned.values()))
28272827
self._check_axes_shape(returned, axes_num=3, layout=(1, 3))
28282828
self.assert_numpy_array_equal(returned, axes[0])
28292829
self.assertIs(returned[0].figure, fig)
28302830
# draw on second row
28312831
returned = df.groupby('classroom').boxplot(column=['height', 'weight', 'category'],
28322832
return_type='axes', ax=axes[1])
2833-
returned = np.array(returned.values())
2833+
returned = np.array(list(returned.values()))
28342834
self._check_axes_shape(returned, axes_num=3, layout=(1, 3))
28352835
self.assert_numpy_array_equal(returned, axes[1])
28362836
self.assertIs(returned[0].figure, fig)

0 commit comments

Comments
 (0)