강의

멘토링

커뮤니티

Inflearn Community Q&A

ashowl's profile image
ashowl

asked

Mastering Data Analysis and Visualization with Just Two Documents

3) Indexing with Pandas dataframe comparison operator, drop_duplicates()

컬럼 선택하기

Written on

·

170

2

1. df.컬럼명

2. df["컬럼명"] 

1번과 2번이 같다고 하셨는데요 1번만 써야하는경우 또는 2번 형식만 써야하는 경우가 있나요?

pandaspython

Answer 3

1

todaycode님의 프로필 이미지
todaycode
Instructor

안녕하세요.

2. df["컬럼명"] 은 어떤 컬럼이든 사용할 수 있습니다.

1. df.컬럼명 은 컬럼명에 특수문자 혹은 띄어쓰기가 들어가면 사용할 수가 없습니다.

그래서 저는 주로 2번의 방법으로 사용하는 편입니다.

0

todaycode님의 프로필 이미지
todaycode
Instructor

감사합니다 :)

0

ashowl님의 프로필 이미지
ashowl
Questioner

감사합니다 4번강의에서도  설명 나오네요

ashowl's profile image
ashowl

asked

Ask a question