【发布时间】:2016-09-19 09:44:17
【问题描述】:
我正在使用通过Apache Toree 在Jupyter Notebook 中使用Anaconda v4.0.0 (Python 2.7.11) 安装的PySpark 内核。从Hive 获取表格后,使用matplotlib/panda 在 Jupyter notebook 中绘制一些图表,如下所示:
%matplotlib inline
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
# Set some Pandas options
pd.set_option('display.notebook_repr_html', False)
pd.set_option('display.max_columns', 20)
pd.set_option('display.max_rows', 25)
normals = pd.Series(np.random.normal(size=10))
normals.plot()
当我尝试使用显示的 %matplotlib inline 时,我被困在第一个链接上
Name: Error parsing magics!
Message: Magics [matplotlib] do not exist!
StackTrace:
查看Toree Magic 和MagicManager,我意识到%matplotlib 正在调用MagicManager 而不是iPython in-build 魔术命令。
Apache Toree - PySpark 是否可以改用 iPython 内置魔法命令?
【问题讨论】:
-
安装
matplotlib? -
@zero323 我可以导入
matplotlib,但是当我尝试在Jupyter notebook 控制台上运行%matplotlib inline时显示16/09/20 09:40:24 ERROR magic.MagicManager: No magic found for matplotlib有没有办法让iPython 魔法发挥作用?
标签: matplotlib ipython pyspark jupyter apache-toree