강의

멘토링

커뮤니티

Inflearn Community Q&A

minhyung01239529's profile image
minhyung01239529

asked

Getting started with Python data analysis using public data

[8/21] Changing data types and creating derived variables through dates

style.background_gradient() 타입

Written on

·

370

6

이렇게 float 형으로 나오는데 정수형으로 어떻게 바꾸나요??

pythonnumpypandas

Answer 1

4

todaycode님의 프로필 이미지
todaycode
Instructor

안녕하세요.

아래와 같이 작성해 보세요.

아래의 round(0) 은 안 해줘도 상관 없지만 나중에 소수점이 있는 숫자를 자르고자 할때 사용하시면 유용할거 같습니다.

round(0)을 하고 타입을 정수로 변경하면 아래와 같이 나옵니다.

year_month.round(0).astype(int).style.background_gradient() 

minhyung01239529's profile image
minhyung01239529

asked

Ask a question