List comprehension vs map
Is there a reason to prefer using map() over list comprehension or vice versa? Is either of them generally more efficient or considered generally more Pythonic than the other?
stackoverflow.com
람다 없이 같은 함수를 쓴다면 map이 조금 더 빠르고,
람다로 함수를 선언한다면 list comprehension이 조금 더 빠르다.
'TIL' 카테고리의 다른 글
HDFS 휴지통 복구, HDFS 파일 복구, HDFS 폴더 복구 (0) | 2022.07.21 |
---|---|
Conv1D, Conv2D, Conv3D 차이 (0) | 2021.11.22 |
include_top의 의미 (0) | 2021.11.17 |
입력 이미지(input image)를 정규화(normalize)하는 이유 (0) | 2021.11.11 |
ValueError: output array is read-only (0) | 2021.11.08 |