我的jupyter笔记本,读取我创建的模块,在Jupyter中添加
sc.addPyFile('wasb:///HdiNotebooks/PySpark/project/read_test_data.py')
然后加载模块ok,
然而,我的" py"文件,将数据打开为:
data_file= open('wasb:///example/data/fruits.txt', 'rU')
to prepare it and do different calculations.
但是,我收到以下错误
[Errno 2] No such file or directory: 'wasb:///example/data/fruits.txt'
Traceback (most recent call last):
FileNotFoundError: [Errno 2] No such file or directory: 'wasb:///example/data/fruits.txt'
如果我尝试在jupyter中创建一个具有相同数据的数据帧,我运行
df=sqlContext.read.csv('wasb:///example/data/fruits.txt',header='true', inferSchema='true')
我没有得到任何错误。我做错了什么?