시작하기무료로 시작하기

날짜에서 특징 만들기

또 다른 특징 엔지니어링 작업은 월과 연도를 추출하는 것입니다. 이 작업을 ufo 데이터셋의 date 열에 수행하세요.

이 연습은 강의의 일부입니다

Python으로 배우는 Machine Learning 전처리

강의 보기

연습 안내

  • date 열의 .head()를 출력하세요.
  • date 열에서 month 속성을 추출하세요.
  • date 열에서 year 속성을 추출하세요.
  • date, month, year 열의 .head()를 확인하세요.

실습형 인터랙티브 연습

이 예제를 이 샘플 코드를 완성하여 풀어보세요.

# Look at the first 5 rows of the date column
print(____)

# Extract the month from the date column
ufo["month"] = ufo["date"].____

# Extract the year from the date column
ufo["year"] = ufo["date"].____

# Take a look at the head of all three columns
print(____)
코드 편집 및 실행