• 카테고리

    질문 & 답변
  • 세부 분야

    딥러닝 · 머신러닝

  • 해결 여부

    미해결

파일 인식을 못한다고 합니다.

21.01.07 12:50 작성 조회수 314

0

안녕하세요 좋은 강의 잘 듣고 있습니다. 하지만 파일 경로에 타이타닉 파일을 복사하고 실행을 하는데 파일 디렉토리에 없다고 합니다. 그래서 다시 저장하고 위치까지 확인한 다음에 다시 해봐도 같은 에러가 나오네요 1장에서 했던것처럼 똑같이 했는데 혹시 다른 방법이 있을까요?

답변 2

·

답변을 작성해보세요.

0

안녕하십니까,

file 위치가 './titanic_train.csv' 이니, 수행하신 jupyter notebook과 동일한 디렉토리에 titanic_train.csv가 있는지 확인 부탁드립니다.  그래도 안되면 절대 경로를 입력해서 다시 해보시고, 안되면 여기에 다시 업데이트 부탁드립니다.

감사합니다.

0

최상원님의 프로필

최상원

질문자

2021.01.07

---------------------------------------------------------------------------
FileNotFoundError                         Traceback (most recent call last)
<ipython-input-2-a2874fbb5fc3> in <module>
      5 get_ipython().run_line_magic('matplotlib', 'inline')
      6 
----> 7 titanic_df=pd.read_csv('./titanic_train.csv')
      8 titanic_df.head(3)

~\anaconda3\lib\site-packages\pandas\io\parsers.py in read_csv(filepath_or_buffer, sep, delimiter, header, names, index_col, usecols, squeeze, prefix, mangle_dupe_cols, dtype, engine, converters, true_values, false_values, skipinitialspace, skiprows, skipfooter, nrows, na_values, keep_default_na, na_filter, verbose, skip_blank_lines, parse_dates, infer_datetime_format, keep_date_col, date_parser, dayfirst, cache_dates, iterator, chunksize, compression, thousands, decimal, lineterminator, quotechar, quoting, doublequote, escapechar, comment, encoding, dialect, error_bad_lines, warn_bad_lines, delim_whitespace, low_memory, memory_map, float_precision)
    684     )
    685 
--> 686     return _read(filepath_or_buffer, kwds)
    687 
    688 

~\anaconda3\lib\site-packages\pandas\io\parsers.py in _read(filepath_or_buffer, kwds)
    450 
    451     # Create the parser.
--> 452     parser = TextFileReader(fp_or_buf, **kwds)
    453 
    454     if chunksize or iterator:

~\anaconda3\lib\site-packages\pandas\io\parsers.py in __init__(self, f, engine, **kwds)
    944             self.options["has_index_names"] = kwds["has_index_names"]
    945 
--> 946         self._make_engine(self.engine)
    947 
    948     def close(self):

~\anaconda3\lib\site-packages\pandas\io\parsers.py in _make_engine(self, engine)
   1176     def _make_engine(self, engine="c"):
   1177         if engine == "c":
-> 1178             self._engine = CParserWrapper(self.f, **self.options)
   1179         else:
   1180             if engine == "python":

~\anaconda3\lib\site-packages\pandas\io\parsers.py in __init__(self, src, **kwds)
   2006         kwds["usecols"] = self.usecols
   2007 
-> 2008         self._reader = parsers.TextReader(src, **kwds)
   2009         self.unnamed_cols = self._reader.unnamed_cols
   2010 

pandas\_libs\parsers.pyx in pandas._libs.parsers.TextReader.__cinit__()

pandas\_libs\parsers.pyx in pandas._libs.parsers.TextReader._setup_parser_source()

FileNotFoundError: [Errno 2] No such file or directory: './titanic_train.csv'

에러코드는 이렇게 나옵니다.