简体   繁体   English

Python 2.7 Anaconda Pandas错误(Ubuntu 14.04)

[英]Python 2.7 Anaconda Pandas error(Ubuntu 14.04)

I'm doing a data science course on udemy using python 2.7, running Anaconda. 我正在使用蟒蛇2.7(正在运行Anaconda)上关于udemy的数据科学课程。 My OS is Ubuntu 14.04. 我的操作系统是Ubuntu 14.04。

I'm getting the following error running with the pandas module: 我在使用pandas模块运行时遇到以下错误:

Traceback (most recent call last): File "/home/flyveren/PycharmProjects/Udemy/15_DataFrames.py", line 13, in <module> nfl_frame = pd.read_clipboard() File "/home/flyveren/anaconda/lib/python2.7/site-packages/pandas/io/clipboard.py", line 51, in read_clipboard return read_table(StringIO(text), **kwargs) File "/home/flyveren/anaconda/lib/python2.7/site-packages/pandas/io/parsers.py", line 474, in parser_f return _read(filepath_or_buffer, kwds) File "/home/flyveren/anaconda/lib/python2.7/site-packages/pandas/io/parsers.py", line 260, in _read return parser.read() File "/home/flyveren/anaconda/lib/python2.7/site-packages/pandas/io/parsers.py", line 721, in read ret = self._engine.read(nrows) File "/home/flyveren/anaconda/lib/python2.7/site-packages/pandas/io/parsers.py", line 1170, in read data = self._reader.read(nrows) File "pandas/parser.pyx", line 769, in pandas.parser.TextReader.read (pandas/parser.c:7544) File "pandas/parser.pyx", line 791, in pandas.parser.TextReader._read_low_memory (pandas/parser.c:7784) File "pandas/parser.pyx", line 844, in pandas.parser.TextReader._read_rows (pandas/parser.c:8401) File "pandas/parser.pyx", line 831, in pandas.parser.TextReader._tokenize_rows (pandas/parser.c:8275) File "pandas/parser.pyx", line 1742, in pandas.parser.raise_parser_error (pandas/parser.c:20691) pandas.parser.CParserError: Error tokenizing data. C error: Expected 11 fields in line 5, saw 12

I've tried conda uninstall pandas and subsequently conda install pandas again to see, however with the same result. 我试过conda uninstall pandas ,然后再次conda install pandas看看,但是结果相同。 The package is there, it tells me an error if I uninstall and try to run the code again with missing package, but it gives this error when it's properly installed. 软件包在那里,如果我卸载并尝试在缺少软件包的情况下再次运行代码,它会告诉我一个错误,但是如果正确安装,它将给出此错误。

Anyone knows what's up? 有人知道怎么回事吗?

So, the solution was essentially to create a virtual environment and install the needed packages independently. 因此,解决方案实质上是创建一个虚拟环境并独立安装所需的软件包。 Some issues with dependencies on my system, I believe. 我相信某些依赖于我系统的问题。

I watch same lecture at udemy and face same problem. 我在udemy看同一堂课,面临着同样的问题。

I change my browser from internet explorer to chrome. 我将浏览器从Internet Explorer更改为chrome。 (I'm using windows7 & VS2013 with PTVS) (我在PTVS中使用Windows7和VS2013)

Then, error does not occur. 然后,不会发生错误。

However, delimeter has some problem. 但是,分度仪存在一些问题。 Space should not be used as delimeter according to lecture, however, it does. 根据演讲,不应将空间用作度量单位,但会这样做。 So, result is not perfect. 因此,结果并不完美。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM