728x90
    
    
    
  Python에서 문자열.zfill(길이) 함수를 통해 왼쪽에 0을 채울 수 있습니다.
또한 문자열.rjust(길이, 채울문자), 문자열.ljust(길이, 채울문자) 함수를 통해 왼쪽, 오른쪽을 채울 수 있습니다.

728x90
    
    
    
  'Python' 카테고리의 다른 글
| yahoo 주식 datareader key error date (0) | 2021.01.18 | 
|---|---|
| pd.dataframe Argument 'rows' has incorrect type (expected list, got tuple) (0) | 2021.01.18 | 
| python dataframe 열 순서 변경 (0) | 2020.03.25 | 
| using minist dataset without network (0) | 2020.01.09 | 
| numpy array 차원 삭제 (0) | 2020.01.09 |