Problems with pd.read_csv
<p>I have Anaconda 3 on Windows 10. I am using pd.read_csv() to load csv files but I get error messages.  To begin with I tried <code>df = pd.read_csv('C:\direct_marketing.csv')</code> which worked and the file was imported.</p>

<p>Then I tried <code>df = pd.read_csv('C:\tutorial.csv')</code> and I received the following error message:</p>

<pre><code>Traceback (most recent call last):

  File "&lt;ipython-input-3-ce208cc2684f&gt;", line 1, in &lt;module&gt;
    df = pd.read_csv('C:\tutorial.csv')

  File "C:\Users\Alexandros_7\Anaconda3\lib\site-packages\pandas\io\parsers.py", line 562, in parser_f
    return _read(filepath_or_buffer, kwds)

  File "C:\Users\Alexandros_7\Anaconda3\lib\site-packages\pandas\io\parsers.py", line 315, in _read
    parser = TextFileReader(filepath_or_buffer, **kwds)

  File "C:\Users\Alexandros_7\Anaconda3\lib\site-packages\pandas\io\parsers.py", line 645, in __init__
    self._make_engine(self.engine)

  File "C:\Users\Alexandros_7\Anaconda3\lib\site-packages\pandas\io\parsers.py", line 799, in _make_engine
    self._engine = CParserWrapper(self.f, **self.options)

  File "C:\Users\Alexandros_7\Anaconda3\lib\site-packages\pandas\io\parsers.py", line 1213, in __init__
    self._reader = _parser.TextReader(src, **kwds)

  File "pandas\parser.pyx", line 358, in pandas.parser.TextReader.__cinit__ (pandas\parser.c:3427)

  File "pandas\parser.pyx", line 628, in pandas.parser.TextReader._setup_parser_source (pandas\parser.c:6861)

OSError: File b'C:\tutorial.csv' does not exist
</code></pre>

<p>Then I moved the file to a new folder and renamed it and again used read.csv() to import it: </p>

<pre><code>df = pd.read_csv('C:\Users\test.csv')
</code></pre>

<p>This time I received a different error message:</p>

<pre><code>  File "&lt;ipython-input-5-03c6d380c174&gt;", line 1
    df = pd.read_csv('C:\Users\test.csv')
                    ^
SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in position 2-3: truncated \UXXXXXXXX escape
</code></pre>

<p>Could you help me understand what is going on and how to handle this situation?</p>

<p>Thanks a lot!</p>

<p>try use two back-slash '\' instead of '\'. It might have take it as a escape sign.. ?</p>

python csv