Nov-05-2019, 02:19 PM
I have a problem importing a CSV file. I have tried with r' and singel / and dubbel \\ both ways. The same problem.
But I can easily import the same file in R-studio with
"df <- read.csv2(file="G:\\Analyser\\2019 OS\\test.csv",head=TRUE)"
Anybody have a clue what I´m doing wrong? I´m using Anaconda Spyder and I can also import the file directly.
But I can easily import the same file in R-studio with
"df <- read.csv2(file="G:\\Analyser\\2019 OS\\test.csv",head=TRUE)"
Anybody have a clue what I´m doing wrong? I´m using Anaconda Spyder and I can also import the file directly.
import pandas as pd pd.read_csv("G:\\Analyser\\2019 OS\\test.csv", header=None)My error message is:
Traceback (most recent call last): File "<ipython-input-2-90f87efa86d2>", line 3, in <module> pd.read_csv("G:\\Analyser\\2019 OS\\test.csv", header=None) File "C:\ProgramData\Anaconda3\lib\site-packages\pandas\io\parsers.py", line 702, in parser_f return _read(filepath_or_buffer, kwds) File "C:\ProgramData\Anaconda3\lib\site-packages\pandas\io\parsers.py", line 435, in _read data = parser.read(nrows) File "C:\ProgramData\Anaconda3\lib\site-packages\pandas\io\parsers.py", line 1139, in read ret = self._engine.read(nrows) File "C:\ProgramData\Anaconda3\lib\site-packages\pandas\io\parsers.py", line 1995, in read data = self._reader.read(nrows) File "pandas/_libs/parsers.pyx", line 899, in pandas._libs.parsers.TextReader.read File "pandas/_libs/parsers.pyx", line 914, in pandas._libs.parsers.TextReader._read_low_memory File "pandas/_libs/parsers.pyx", line 968, in pandas._libs.parsers.TextReader._read_rows File "pandas/_libs/parsers.pyx", line 955, in pandas._libs.parsers.TextReader._tokenize_rows File "pandas/_libs/parsers.pyx", line 2172, in pandas._libs.parsers.raise_parser_error ParserError: Error tokenizing data. C error: Expected 1 fields in line 4, saw 2