Jupyter 实验室问题:在执行代码时 Python3 内核变得忙碌

时间:2021-05-19 23:11:22

标签: jupyter-lab

问题:在 docer 图像 jupyter lab 上运行相同的代码,但如果我在本地启动 jupyter lab 并尝试运行相同的代码:

  • 内核变得忙碌并保持该状态,除非我停止内核。但从未显示任何结果。[导航器针对所选内核显示黑色黑圈:Python3]

寻求帮助:如何在本地jupyter实验室执行代码并得到结果。

enter code here
from pyspark.sql.types import StructType, StructField, FloatType, 
BooleanType
from pyspark.sql.types import DoubleType, IntegerType, StringType
import pyspark

from pyspark import SQLContext

conf = pyspark.SparkConf() 

sc = pyspark.SparkContext.getOrCreate(conf=conf)
sqlcontext = SQLContext(sc)

schema = StructType([
StructField("sales", IntegerType(),True), 
StructField("sales person", StringType(),True)
                    ])
data = ([(10, 'Walker'),
    ( 20, 'Stepher')
    ])

df=sqlcontext.createDataFrame(data,schema=schema)

df.show()

0 个答案:

没有答案