Intentando cargar el archivo en Python pero dice que no existe aunque sí existe
Estoy tratando de cargar un archivo csv en Pandas. Recibo un error extraño que nunca antes había encontrado que el archivo no existe a pesar de que sí existe. El error también llama al archivo con un nombre diferente en el mensaje "ree.csv"
import pandas as pd
tree = pd.read_csv('C:\Users\Desktop\tree.csv')
IOError
Traceback (most recent call last)
<ipython-input-63-aed3b96442f2> in <module>()
----> 1 tree = pd.read_csv('C:\Users\Desktop\tree.csv')
C:\Users\AppData\Local\Continuum\Anaconda\lib\site-packages\pandas\io\parsers.pyc in parser_f(filepath_or_buffer, sep, dialect, compression, doublequote, escapechar, quotechar, quoting, skipinitialspace, lineterminator, header, index_col, names, prefix, skiprows, skipfooter, skip_footer, na_values, na_fvalues, true_values, false_values, delimiter, converters, dtype, usecols, engine, delim_whitespace, as_recarray, na_filter, compact_ints, use_unsigned, low_memory, buffer_lines, warn_bad_lines, error_bad_lines, keep_default_na, thousands, comment, decimal, parse_dates, keep_date_col, dayfirst, date_parser, memory_map, nrows, iterator, chunksize, verbose, encoding, squeeze, mangle_dupe_cols, tupleize_cols)
398 )
399
--> 400 return _read(filepath_or_buffer, kwds)
401
402 parser_f.__name__ = name
C:\Users\AppData\Local\Continuum\Anaconda\lib\site-packages\pandas\io\parsers.pyc in _read(filepath_or_buffer, kwds)
196
197 # Create the parser.
--> 198 parser = TextFileReader(filepath_or_buffer, **kwds)
199
200 if nrows is not None:
C:\Users\AppData\Local\Continuum\Anaconda\lib\site-packages\pandas\io\parsers.pyc in __init__(self, f, engine, **kwds)
477 self.options['has_index_names'] = kwds['has_index_names']
478
--> 479 self._make_engine(self.engine)
480
481 def _get_options_with_defaults(self, engine):
C:\Users\AppData\Local\Continuum\Anaconda\lib\site-packages\pandas\io\parsers.pyc in _make_engine(self, engine)
584 def _make_engine(self, engine='c'):
585 if engine == 'c':
--> 586 self._engine = CParserWrapper(self.f, **self.options)
587 else:
588 if engine == 'python':
C:\Users\AppData\Local\Continuum\Anaconda\lib\site-packages\pandas\io\parsers.pyc in __init__(self, src, **kwds)
955 kwds['allow_leading_cols'] = self.index_col is not False
956
--> 957 self._reader = _parser.TextReader(src, **kwds)
958
959 # XXX
C:\Users\AppData\Local\Continuum\Anaconda\lib\site-packages\pandas\parser.pyd in pandas.parser.TextReader.__cinit__ (pandas\parser.c:2987)()
C:\Users\AppData\Local\Continuum\Anaconda\lib\site-packages\pandas\parser.pyd in pandas.parser.TextReader._setup_parser_source (pandas\parser.c:5345)()
IOError: File C:\Users\Desktop ree.csv does not exist