[pandas] DataFrame 특정 열 소수점자리 설정하기
먼저, 소수점자리 설정을 위해 테스트할 데이터프레임을 생성합니다. import pandas as pd import numpy as np file = pd.DataFrame({ 'test': [-0.15, 0.54, -0.77, 0.92], }) 소수점자리를 설정하는 방법에는 3가지가 있습니다. ceil, round, floor 하나씩 테스트해가면서 알아봅시당 1. round : round는 원하는 자리수까지 소수점을 반올림 합니다. 자리수를 설정하지 않을 경우 default는 소수점 첫번째자리수를 반올림하여, 소수점을 없애버리는 것. # round - 1번째자리까지 반올림 column = 'test' where = 1 file[column]= round(file[column], where) # round..