inflearn logo
강의

강의

N
챌린지

챌린지

멘토링

멘토링

N
클립

클립

로드맵

로드맵

지식공유

[개정판] 파이썬 머신러닝 완벽 가이드

판다스(Pandas) 개요와 기본 API - 01

titanic_train.csv가 인식이 안됩니다

559

dao4607

작성한 질문수 1

0

 

 
 
 
titanic_df = pd.read_csv('titanic_train.csv')
print('titanic 변수 type:',type(titanic_df))

---------------------------------------------------------------------------
FileNotFoundError Traceback (most recent call last) C:\Users\ADMINI~1\AppData\Local\Temp/ipykernel_30904/3046420676.py in <module> ----> 1 titanic_df = pd.read_csv('titanic_train.csv') 2 print('titanic 변수 type:',type(titanic_df)) ~\anaconda3\lib\site-packages\pandas\util\_decorators.py in wrapper(*args, **kwargs) 309 stacklevel=stacklevel, 310 ) --> 311 return func(*args, **kwargs) 312 313 return wrapper ~\anaconda3\lib\site-packages\pandas\io\parsers\readers.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, encoding_errors, dialect, error_bad_lines, warn_bad_lines, on_bad_lines, delim_whitespace, low_memory, memory_map, float_precision, storage_options) 584 kwds.update(kwds_defaults) 585 --> 586 return _read(filepath_or_buffer, kwds) 587 588 ~\anaconda3\lib\site-packages\pandas\io\parsers\readers.py in _read(filepath_or_buffer, kwds) 480 481 # Create the parser. --> 482 parser = TextFileReader(filepath_or_buffer, **kwds) 483 484 if chunksize or iterator: ~\anaconda3\lib\site-packages\pandas\io\parsers\readers.py in __init__(self, f, engine, **kwds) 809 self.options["has_index_names"] = kwds["has_index_names"] 810 --> 811 self._engine = self._make_engine(self.engine) 812 813 def close(self): ~\anaconda3\lib\site-packages\pandas\io\parsers\readers.py in _make_engine(self, engine) 1038 ) 1039 # error: Too many arguments for "ParserBase" -> 1040 return mapping[engine](self.f, **self.options) # type: ignore[call-arg] 1041 1042 def _failover_to_python(self): ~\anaconda3\lib\site-packages\pandas\io\parsers\c_parser_wrapper.py in __init__(self, src, **kwds) 49 50 # open handles ---> 51 self._open_handles(src, kwds) 52 assert self.handles is not None 53 ~\anaconda3\lib\site-packages\pandas\io\parsers\base_parser.py in _open_handles(self, src, kwds) 220 Let the readers open IOHandles after they are done with their potential raises. 221 """ --> 222 self.handles = get_handle( 223 src, 224 "r", ~\anaconda3\lib\site-packages\pandas\io\common.py in get_handle(path_or_buf, mode, encoding, compression, memory_map, is_text, errors, storage_options) 700 if ioargs.encoding and "b" not in ioargs.mode: 701 # Encoding --> 702 handle = open( 703 handle, 704 ioargs.mode, FileNotFoundError: [Errno 2] No such file or directory: 'titanic_train.csv'
왜 인식이 안되는지 잘 모르겠습니다
밑에 글에 같은 저장공간에 두시라고하셨는데 titanic_train.csv파일을 한 파일 안에 같이 넣었지만 이런 문제가 발생합니다

titanic_train.csv 머신러닝 배워볼래요? 통계 python

답변 2

0

dao4607

자세한 답변 감사합니다 덕분에 절대 경로를 복사하는 방법을 학습 할 수 있었습니다. 하지만 여전히 오류가 이렇게 발생이 됩니다. 말씀하신 대로 주피터 노트북이 실행되는 디렉토리안에 titanic.train.csv파일을 같이 넣었지만 같은 파일 안에 넣어둔 사진도 첨부했습니다. 

0

권 철민

다운로드를 c:\ 밑에 바로 하시는게 어떨지요?  그런 다음에 pd.read_csv(r'c:\titanic_train.csv') 로 읽어 들이시면 될 것 같습니다. 

0

권 철민

안녕하십니까, 

주피터 노트북이 수행되는 디렉토리에 titanic_train.csv를 놓으시면 됩니다. 

주피터 노트북이 수행되는 디렉토리가 어딘지 모르시면,  보통은 C:\사용자\사용자명 디렉토리 아래에 실습 코드를 풀어 놓은 곳에서 확인하시면 됩니다.  그래도 안되면 read_csv() 절대 경로를 넣어 주십시요. 

가령 c:\users\q 디렉토리에 titanic_train.csv 파일을 저장했으면 pd.read_csv(r'c:\users\q\titanic_train.csv') 하시면 됩니다. 

감사합니다. 

모델 서빙과 관련된 강좌가 출시되는지 질문드립니다.

0

19

2

안녕하세요 열심히 수강중인 학생입니다

0

63

2

정수 인덱싱

0

69

2

넘파이 오류

0

85

2

11강 numpy의 axis 축 질문 드립니다.

0

87

2

Kaggle 에서 Santander customer satisfaction data 를 다운로드 되지가 않습니다.

0

79

2

Feature importances 를 보여주는 barplot 이 그래프로 안보여져요.

0

70

2

타이타닉 csv 파일이 주피터 화면에 보이지 않습니다.

0

75

2

타이타닉 csv 파일이 주피터 화면에 보이지 않습니다.

0

64

2

5강 강의 오류가 있어요.

0

85

1

실무에서 LTV 관련 모델 선택 질문입니다!

0

72

2

14강 강의 듣는중에 궁금한게 있어서 질문합니다~

0

69

3

파이썬 다운그레이 후 사이킷런 재설치

0

119

2

좋은 강의 감사합니다.

0

74

2

scoring 함수 음수값

0

67

2

6번 강의에 사이킷런, 파이썬, 아나콘다 각각 버전 일치 안 시키고 진행해도 강의 따라가 지나요?

0

100

2

분류 평가 정확도 예측

0

79

2

안녕하세요. 강의 들으면서 업무에 적용하고 싶은 수강생입니다.

0

99

1

카카오톡 채널 있나요

0

108

1

혹시 강의에서 사용하시는 ppt 받을 수 있는건가요

0

190

2

pca 스케일링 관련하여 질문드립니다.

0

100

2

주피터 대신 구글 코랩

0

172

2

강의에서 사용하는 pdf or ppt자료는 따로 없는 건가요?

0

148

2

실루엣 스코어..

0

86

2