Кто-нибудь знает, в чем проблема?
Код: Выделить всё
AssertionError Traceback (most recent call last)
Cell In[9], line 1
----> 1 a2_data.boxplot(column=['MinTemp', 'MaxTemp', 'Rainfall', 'Evaporation', 'WindGustSpeed', 'WindSpeed9am', 'WindSpeed3pm', 'Humidity9am', 'Humidity3pm', 'Temp9am','Temp3pm'],rot=90);
File C:\Program Files\Python312\Lib\site-packages\pandas\plotting\_core.py:533, in boxplot_frame(self, column, by, ax, fontsize, rot, grid, figsize, layout, return_type, backend, **kwargs)
516 @Substitution(data="", backend=_backend_doc)
517 @Appender(_boxplot_doc)
518 def boxplot_frame(
(...)
530 **kwargs,
531 ):
532 plot_backend = _get_plot_backend(backend)
--> 533 return plot_backend.boxplot_frame(
534 self,
535 column=column,
536 by=by,
537 ax=ax,
538 fontsize=fontsize,
539 rot=rot,
540 grid=grid,
541 figsize=figsize,
542 layout=layout,
543 return_type=return_type,
544 **kwargs,
545 )
File C:\Program Files\Python312\Lib\site-packages\pandas\plotting\_matplotlib\boxplot.py:492, in boxplot_frame(self, column, by, ax, fontsize, rot, grid, figsize, layout, return_type, **kwds)
477 def boxplot_frame(
478 self,
479 column=None,
(...)
488 **kwds,
489 ):
490 import matplotlib.pyplot as plt
--> 492 ax = boxplot(
493 self,
494 column=column,
495 by=by,
496 ax=ax,
497 fontsize=fontsize,
498 grid=grid,
499 rot=rot,
500 figsize=figsize,
501 layout=layout,
502 return_type=return_type,
503 **kwds,
504 )
505 plt.draw_if_interactive()
506 return ax
File C:\Program Files\Python312\Lib\site-packages\pandas\plotting\_matplotlib\boxplot.py:471, in boxplot(data, column, by, ax, fontsize, rot, grid, figsize, layout, return_type, **kwds)
468 else:
469 data = data[columns]
--> 471 result = plot_group(columns, data.values.T, ax, **kwds)
472 ax.grid(grid)
474 return result
File C:\Program Files\Python312\Lib\site-packages\pandas\plotting\_matplotlib\boxplot.py:414, in boxplot..plot_group(keys, values, ax, **kwds)
411 ax.tick_params(axis="both", labelsize=fontsize)
413 # GH 45465: x/y are flipped when "vert" changes
--> 414 _set_ticklabels(
415 ax=ax, labels=keys, is_vertical=kwds.get("vert", True), rotation=rot
416 )
417 maybe_color_bp(bp, color_tup=colors, **kwds)
419 # Return axes in multiplot case, maybe revisit later # 985
File C:\Program Files\Python312\Lib\site-packages\pandas\plotting\_matplotlib\boxplot.py:57, in _set_ticklabels(ax, labels, is_vertical, **kwargs)
55 if len(ticks) != len(labels):
56 i, remainder = divmod(len(ticks), len(labels))
---> 57 assert remainder == 0, remainder
58 labels *= i
59 if is_vertical:
AssertionError: 3
Я ожидаю, что графики будут создаваться в строке, по одному после каждого имеющегося у меня блока кода. Другие функции pandas работают нормально, это просто построение графиков, в частности matplotlib.
Изменение команды на один столбец приводит к пустому выводу
Код: Выделить всё
a2_data.boxplot(column='Pressure9am')
Код: Выделить всё
Подробнее здесь: https://stackoverflow.com/questions/790 ... b-notebook