使用Jupyter Notebook将CSV文件加载到数据框时出现错误 [英] Getting error when loading CSV file to dataframe using Jupyter notebook

查看:296
本文介绍了使用Jupyter Notebook将CSV文件加载到数据框时出现错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

sc = pyspark.SparkContext()
sqlCxt = SQLContext(sc)
df=sqlCxt.read.format("csv").option("delimiter","|").load("D:/SparkPy/u.item")

错误:

ERROR:root:标记输入时发生意外错误 以下回溯可能已损坏或无效 错误消息是:('EOF in multi-line string',(651,72))

ERROR:root:An unexpected error occurred while tokenizing input The following traceback may be corrupted or invalid The error message is: ('EOF in multi-line string', (651, 72))

推荐答案

当我将Spark更新到版本2.2.0时,该问题已解决.

The issue got resolved when I updated the Spark to version 2.2.0 .

Python 3.6与Spark v2.2.0兼容

Python 3.6 is compatible with Spark v2.2.0

这篇关于使用Jupyter Notebook将CSV文件加载到数据框时出现错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆