我按照此链接http://ramhiser.com/2015/02/01/configuring-ipython-notebook-support-for-pyspark/ 为IPython创建PySpark配置文件.
00-pyspark-setup.py
# Configure the necessary Spark environment
import os
import sys
spark_home = os.environ.get('SPARK_HOME', None)
sys.path.insert(0, spark_home + "\python")
# Add the py4j to the path.
# You may need to change the version number to match your install
sys.path.insert(0, os.path.join(spark_home, '\python\lib\py4j-0.8.2.1-src.zip'))
# Initialize PySpark to predefine the SparkContext variable 'sc'
execfile(os.path.join(spark_home, '\python\pyspark\shell.py'))
Run Code Online (Sandbox Code Playgroud)
当我输入scipython-notebook时,我的问题是,我得到的''输出类似于<pyspark.context.SparkContext at 0x1097e8e90>.
有关如何解决它的任何想法?