# 여러 원소가 들어가 있는 하나의 리스트 (list_a)를 한번에 int 형태로 바꾸고자 한다.
int_list = [int(i) for i in list_a]
또는
int_list = list(map(int, list_a))
반응형
'Language > python' 카테고리의 다른 글
[Python] requirements.txt로 패키지 관리 (0) | 2023.06.29 |
---|---|
[Python] 파일 확장자명 일괄변경 (0) | 2023.04.27 |
[Python] Image 읽는 방법 (0) | 2023.02.10 |
[에러] TypeError : can't convert CUDA tensor to numpy (0) | 2023.02.09 |
[numpy] numpy 소수점 반올림하기 / array 전체 출력 / 출력 형식 변경 (0) | 2023.01.25 |