mglearn icon indicating copy to clipboard operation
mglearn copied to clipboard

mglearn.plots.plot_cross_val_selection() will throw ValueError

Open liweiwp opened this issue 2 years ago • 0 comments

When I run the method mglearn.plots.plot_cross_val_selection()

I got a error, I installed a pandas v2.0.3

error message:


ValueError Traceback (most recent call last) in ----> 1 mglearn.plots.plot_cross_val_selection()

~\anaconda3\lib\site-packages\mglearn\plot_grid_search.py in plot_cross_val_selection() 26 for i, (_, row) in enumerate(results.iterrows()): 27 scores = row[['split%d_test_score' % i for i in range(5)]] ---> 28 marker_cv, = plt.plot([i] * 5, scores, '^', c='gray', markersize=5, 29 alpha=.5) 30 marker_mean, = plt.plot(i, row.mean_test_score, 'v', c='none', alpha=1,

~\anaconda3\lib\site-packages\pandas\core\indexers\utils.py in disallow_ndim_indexing(result) 341 """ 342 if np.ndim(result) > 1: --> 343 raise ValueError( 344 "Multi-dimensional indexing (e.g. obj[:, None]) is no longer " 345 "supported. Convert to a numpy array before indexing instead."

ValueError: Multi-dimensional indexing (e.g. obj[:, None]) is no longer supported. Convert to a numpy array before indexing instead.

liweiwp avatar Oct 28 '23 13:10 liweiwp