인프런 영문 브랜드 로고
인프런 영문 브랜드 로고

Inflearn Community Q&A

jeonsm9575's profile image
jeonsm9575

asked

Getting started with Python data analysis using public data

[4/15] Understanding the differences between retrieving row and column values with .loc and .iloc

iloc

Written on

·

210

1

cols.iloc[:5,:3] 는 왜 안될까요?

numpypythonpandas

Answer 1

0

todaycode님의 프로필 이미지
todaycode
Instructor

안녕하세요.

cols에 들어있는 값을 출력해 보세요.

DataFrame이 아니라면 질문 주신 방법처럼 데이터 색인을 할 수 없습니다.

.iloc[행, 열] 이기 때문입니다. .iloc[행] 도 가능합니다.

jeonsm9575's profile image
jeonsm9575

asked

Ask a question