我正在嘗試一些熊貓繪製的東西here。然而,每當我嘗試使用下面的命令來設置樣式選項的建議熊貓繪製iPython導致錯誤的選項
pd.options.display.mpl_style = 'default'
我收到以下錯誤
In [6]: Traceback (most recent call last):
File "/Users/seanwhipple/py27/lib/python2.7/site-packages/matplotlib/artist.py", line 59, in draw_wrapper
draw(artist, renderer, *args, **kwargs)
File "/Users/seanwhipple/py27/lib/python2.7/site-packages/matplotlib/figure.py", line 1079, in draw
func(*args)
File "/Users/seanwhipple/py27/lib/python2.7/site-packages/matplotlib/artist.py", line 59, in draw_wrapper
draw(artist, renderer, *args, **kwargs)
File "/Users/seanwhipple/py27/lib/python2.7/site-packages/matplotlib/axes/_base.py", line 2092, in draw
a.draw(renderer)
File "/Users/seanwhipple/py27/lib/python2.7/site-packages/matplotlib/artist.py", line 59, in draw_wrapper
draw(artist, renderer, *args, **kwargs)
File "/Users/seanwhipple/py27/lib/python2.7/site-packages/matplotlib/axis.py", line 1105, in draw
renderer)
File "/Users/seanwhipple/py27/lib/python2.7/site-packages/matplotlib/axis.py", line 1054, in _get_tick_bboxes
extent = tick.label1.get_window_extent(renderer)
File "/Users/seanwhipple/py27/lib/python2.7/site-packages/matplotlib/text.py", line 741, in get_window_extent
bbox, info, descent = self._get_layout(self._renderer)
File "/Users/seanwhipple/py27/lib/python2.7/site-packages/matplotlib/text.py", line 311, in _get_layout
ismath=False)
File "/Users/seanwhipple/py27/lib/python2.7/site-packages/matplotlib/backends/backend_macosx.py", line 166, in get_text_width_height_descent
six.text_type(s), family, size, weight, style)
TypeError: bad argument type for built-in operation
If you suspect this is an IPython bug, please report it at:
https://github.com/ipython/ipython/issues
or send an email to the mailing list at [email protected]
You can print a more detailed traceback right now with "%tb", or use "%debug"
to interactively debug it.
Extra-detailed tracebacks for bug-reporting purposes can be enabled via:
%config Application.verbose_crash=True
在經過我的測試代碼的工作我已經確定,當我加入pd.options
線產生錯誤。有什麼理由呢?我已經更新numpy
,pandas
和matplotlib
到其最新版本使用pip --upgrade
不確定究竟是什麼導致了錯誤,但最新版本的matplotlib添加了一個[樣式包](http://matplotlib.org/users/whats_new.html#style-package-added),它完成了很多熊貓選項的功能。 – TomAugspurger 2014-10-02 01:43:41
關於如何使用它的任何提示? – sedavidw 2014-10-02 01:50:13