Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #49544

File exists but Python says 'not found'.

Newsgroups comp.lang.python
Date 2013-07-01 03:47 -0700
Message-ID <5c1d1e47-b67e-4bce-8601-b14c0215f450@googlegroups.com> (permalink)
Subject File exists but Python says 'not found'.
From prerit86@gmail.com

Show all headers | View raw


I'm running this code that reads 2 csv files (one of them is train.csv). The code gives an error saying 'file not does not exist'. However, the file does exists in the same location as the .py file. Can someone please help me on this. Thanks!

Code Output-->

Reading dataset...
Traceback (most recent call last):
  File "c:\Project_1\regression_2.py", line 163, in <module>
    main(**args)
  File "c:\Project_1\regression_2.py", line 80, in main
    train_data = pd.read_csv(train)
  File "c:\Python27\lib\site-packages\pandas\io\parsers.py", line 401, in parser
_f
    return _read(filepath_or_buffer, kwds)
  File "c:\Python27\lib\site-packages\pandas\io\parsers.py", line 209, in _read
    parser = TextFileReader(filepath_or_buffer, **kwds)
  File "c:\Python27\lib\site-packages\pandas\io\parsers.py", line 509, in __init
__
    self._make_engine(self.engine)
  File "c:\Python27\lib\site-packages\pandas\io\parsers.py", line 611, in _make_
engine
    self._engine = CParserWrapper(self.f, **self.options)
  File "c:\Python27\lib\site-packages\pandas\io\parsers.py", line 893, in __init
__
    self._reader = _parser.TextReader(src, **kwds)
  File "parser.pyx", line 312, in pandas._parser.TextReader.__cinit__ (pandas\sr
c\parser.c:2846)
  File "parser.pyx", line 512, in pandas._parser.TextReader._setup_parser_source
 (pandas\src\parser.c:4893)
IOError: File train.csv does not exist

Back to comp.lang.python | Previous | NextNext in thread | Find similar | Unroll thread


Thread

File exists but Python says 'not found'. prerit86@gmail.com - 2013-07-01 03:47 -0700
  Re: File exists but Python says 'not found'. Robert Kern <robert.kern@gmail.com> - 2013-07-01 11:56 +0100
  Re: File exists but Python says 'not found'. prerit86@gmail.com - 2013-07-01 03:57 -0700
    Re: File exists but Python says 'not found'. Antoon Pardon <antoon.pardon@rece.vub.ac.be> - 2013-07-01 13:15 +0200
      Re: File exists but Python says 'not found'. prerit86@gmail.com - 2013-07-01 04:32 -0700
  Re: File exists but Python says 'not found'. Antoon Pardon <antoon.pardon@rece.vub.ac.be> - 2013-07-01 12:59 +0200
    Re: File exists but Python says 'not found'. prerit86@gmail.com - 2013-07-01 04:00 -0700
      Re: File exists but Python says 'not found'. Dave Angel <davea@davea.name> - 2013-07-01 07:38 -0400
        Re: File exists but Python says 'not found'. prerit86@gmail.com - 2013-07-01 05:17 -0700

csiph-web