2017-09-25 6 views

답변

0

SPSS에서 직접 수행하기가 어렵습니다. 한 가지 가능한 대답은 python + pandas를 사용하는 것입니다.

import pandas as pd 

def add_leading_zero_to_csv(path_to_csv_file): 
    # open the file 
    df_csv = pd.read_csv(path_to_csv_file) 
    # you can possibly specify the format of a column if needed 
    df_csv['specific_column'] = df_csv['specific_column'].map(lambda x: '%.2f' % x) 
    # save the file (with a precision of 3 for all the floats) 
    df_csv.to_csv(path_to_csv_file, index=False, float_format='%.3g') 

"g"형식에 대한 추가 정보 : Format Specification Mini-Language.

부동 소수점 문제에주의하십시오 (예 : answer to this question 참조)