2016-11-22 3 views
1

here과 달리 AttributeError: Unknown property color_cycle은 최신 팬더 버전 (0.19.0-1)에서 계속 유지됩니다. 나는이 아주 예를 구현하는 경우 몇 가지 이유를 들어팬다스 0.19 : boxplot을 수행하는 동안 속성 오류 "unknown property color_cycle"이 계속 존재합니다

 A   B C 
1 05010001 17 1 
2 05020001 5 1 
3 05020002 11 1 
4 05020003 2 1 
5 05030001 86 1 
6 07030001 84 2 
7 07030002 10 2 
8 08010001 16 3 

, 오류가없는 : 내 경우

, 나는 (300 행) 훨씬 더 있지만,이 유사한 dataframe 있습니다. 내 실제 경우에,이 혼란 간단한

df.boxplot(by='C')

을 트리거 실행 :

AttributeError       Traceback (most recent call last) 
<ipython-input-51-5c645348f82f> in <module>() 
----> 1 df.boxplot(by='C') 

C:\Users\B4058846\AppData\Local\Enthought\Canopy\User\lib\site-packages\pandas\core\frame.pyc in boxplot(self, column, by, ax, fontsize, rot, grid, figsize, layout, return_type, **kwds) 
    5514 
    5515   columns = list(data.dtype.names) 
-> 5516   arrays = [data[k] for k in columns] 
    5517   return arrays, columns 
    5518  else: 

C:\Users\B4058846\AppData\Local\Enthought\Canopy\User\lib\site-packages\pandas\tools\plotting.pyc in boxplot(data, column, by, ax, fontsize, rot, grid, figsize, layout, return_type, **kwds) 
    2687  ax : Matplotlib axes object, optional 
    2688  fontsize : int or string 
-> 2689  rot : label rotation angle 
    2690  figsize : A tuple (width, height) in inches 
    2691  grid : Setting this to True will show the grid 

C:\Users\B4058846\AppData\Local\Enthought\Canopy\User\lib\site-packages\pandas\tools\plotting.pyc in _grouped_plot_by_column(plotf, data, columns, by, numeric_only, grid, figsize, ax, layout, return_type, **kwargs) 
    3091  >>> df = pandas.DataFrame(data, columns=list('ABCD'), index=index) 
    3092  >>> 
-> 3093  >>> grouped = df.groupby(level='lvl1') 
    3094  >>> boxplot_frame_groupby(grouped) 
    3095  >>> 

C:\Users\B4058846\AppData\Local\Enthought\Canopy\User\lib\site-packages\pandas\tools\plotting.pyc in plot_group(keys, values, ax) 
    2659  create a figure with the default figsize, causing the figsize=parameter to 
    2660  be ignored. 
-> 2661  """ 
    2662  if ax is None and len(plt.get_fignums()) > 0: 
    2663   ax = _gca() 

C:\Users\B4058846\AppData\Local\Enthought\Canopy\User\lib\site-packages\matplotlib\__init__.pyc in inner(ax, *args, **kwargs) 
    1810      warnings.warn(msg % (label_namer, func.__name__), 
    1811         RuntimeWarning, stacklevel=2) 
-> 1812    return func(ax, *args, **kwargs) 
    1813   pre_doc = inner.__doc__ 
    1814   if pre_doc is None: 

C:\Users\B4058846\AppData\Local\Enthought\Canopy\User\lib\site-packages\matplotlib\axes\_axes.pyc in boxplot(self, x, notch, sym, vert, whis, positions, widths, patch_artist, bootstrap, usermedians, conf_intervals, meanline, showmeans, showcaps, showbox, showfliers, boxprops, labels, flierprops, medianprops, meanprops, capprops, whiskerprops, manage_xticks) 
    3321       meanline=meanline, showfliers=showfliers, 
    3322       capprops=capprops, whiskerprops=whiskerprops, 
-> 3323       manage_xticks=manage_xticks) 
    3324   return artists 
    3325 

C:\Users\B4058846\AppData\Local\Enthought\Canopy\User\lib\site-packages\matplotlib\axes\_axes.pyc in bxp(self, bxpstats, positions, widths, vert, patch_artist, shownotches, showmeans, showcaps, showbox, showfliers, boxprops, whiskerprops, flierprops, medianprops, capprops, meanprops, meanline, manage_xticks) 
    3650      boxes.extend(dopatch(box_x, box_y, **final_boxprops)) 
    3651     else: 
-> 3652      boxes.extend(doplot(box_x, box_y, **final_boxprops)) 
    3653 
    3654    # draw the whiskers 

C:\Users\B4058846\AppData\Local\Enthought\Canopy\User\lib\site-packages\matplotlib\axes\_axes.pyc in doplot(*args, **kwargs) 
    3564   if vert: 
    3565    def doplot(*args, **kwargs): 
-> 3566     return self.plot(*args, **kwargs) 
    3567 
    3568    def dopatch(xs, ys, **kwargs): 

C:\Users\B4058846\AppData\Local\Enthought\Canopy\User\lib\site-packages\matplotlib\__init__.pyc in inner(ax, *args, **kwargs) 
    1810      warnings.warn(msg % (label_namer, func.__name__), 
    1811         RuntimeWarning, stacklevel=2) 
-> 1812    return func(ax, *args, **kwargs) 
    1813   pre_doc = inner.__doc__ 
    1814   if pre_doc is None: 

C:\Users\B4058846\AppData\Local\Enthought\Canopy\User\lib\site-packages\matplotlib\axes\_axes.pyc in plot(self, *args, **kwargs) 
    1422    kwargs['color'] = c 
    1423 
-> 1424   for line in self._get_lines(*args, **kwargs): 
    1425    self.add_line(line) 
    1426    lines.append(line) 

C:\Users\B4058846\AppData\Local\Enthought\Canopy\User\lib\site-packages\matplotlib\axes\_base.pyc in _grab_next_args(self, *args, **kwargs) 
    384     return 
    385    if len(remaining) <= 3: 
--> 386     for seg in self._plot_args(remaining, kwargs): 
    387      yield seg 
    388     return 

C:\Users\B4058846\AppData\Local\Enthought\Canopy\User\lib\site-packages\matplotlib\axes\_base.pyc in _plot_args(self, tup, kwargs) 
    372   ncx, ncy = x.shape[1], y.shape[1] 
    373   for j in xrange(max(ncx, ncy)): 
--> 374    seg = func(x[:, j % ncx], y[:, j % ncy], kw, kwargs) 
    375    ret.append(seg) 
    376   return ret 

C:\Users\B4058846\AppData\Local\Enthought\Canopy\User\lib\site-packages\matplotlib\axes\_base.pyc in _makeline(self, x, y, kw, kwargs) 
    278   default_dict = self._getdefaults(None, kw, kwargs) 
    279   self._setdefaults(default_dict, kw, kwargs) 
--> 280   seg = mlines.Line2D(x, y, **kw) 
    281   self.set_lineprops(seg, **kwargs) 
    282   return seg 

C:\Users\B4058846\AppData\Local\Enthought\Canopy\User\lib\site-packages\matplotlib\lines.pyc in __init__(self, xdata, ydata, linewidth, linestyle, color, marker, markersize, markeredgewidth, markeredgecolor, markerfacecolor, markerfacecoloralt, fillstyle, antialiased, dash_capstyle, solid_capstyle, dash_joinstyle, solid_joinstyle, pickradius, drawstyle, markevery, **kwargs) 
    365   # update kwargs before updating data to give the caller a 
    366   # chance to init axes (and hence unit support) 
--> 367   self.update(kwargs) 
    368   self.pickradius = pickradius 
    369   self.ind_offset = 0 

C:\Users\B4058846\AppData\Local\Enthought\Canopy\User\lib\site-packages\matplotlib\artist.pyc in update(self, props) 
    854     func = getattr(self, 'set_' + k, None) 
    855     if func is None or not six.callable(func): 
--> 856      raise AttributeError('Unknown property %s' % k) 
    857     func(v) 
    858    changed = True 

AttributeError: Unknown property color_cycle 

을 그리고 5 상자 그림과 하나가 있었어야 빈 4 창 플롯, 왼쪽 있어요 열 : enter image description here

해결 방법?

+0

저의 작품은 '0.19.1' 버전을 사용하고 있습니다. – EdChum

답변

1

나는 일이 오류가 발생하지 않도록 matplotlib 1.5.1-8과 함께pandas 0.19.0-1을 가질 필요가 있다는 자신을 확인했습니다.

관련 문제