콘텐츠로 건너뛰기
74. 파이썬 표준 라이브러리 operator.itemgetter operator.attrgetter

74. 파이썬 표준 라이브러리 operator.itemgetter operator.attrgetter

지난 포스팅에서는 functools.reduce() 를 사용해서 리스트 요소의 누적값과 최대값, 최소값을 구하는 코드를 알아봤습니다.이번 포스팅에서는 operator.itemgetter 에 대해 공부해 보도록 하겠습니다. 파이썬 표준 라이브러리 operator.itemgetter operator.itemgetter 라이브러리는 보통 sorted 같은 함수의… 74. 파이썬 표준 라이브러리 operator.itemgetter operator.attrgetter

73. 파이썬 functools.reduce 표준 라이브러리

73. 파이썬 functools.reduce 표준 라이브러리

지난 시간에는 파이썬 표준 라이브러리 itertools.permutations 와 itertools.combinations 에 대해 알아보았습니다.이번 포스팅에서는 파이썬 표준 라이브러리 중 functools.reduce 에 대해 공부해 보도록 하겠습니다. 파이썬 표준 라이브러리 functools.reduce functools.reduce 함수는 functools.reduce(function, iterable)… 73. 파이썬 functools.reduce 표준 라이브러리

72. 파이썬 표준 라이브러리 itertools.permutations itertools.combinations

72. 파이썬 표준 라이브러리 itertools.permutations itertools.combinations

지난 포스팅에서는 itertools.zip_longest 이라는 파이썬 표준 라이브러리에 대해 공부해 보았습니다.이번 포스팅에서는 itertools.permutation 표준 라이브러리에 대해 공부해 보도록 하겠습니다. 파이썬 표준 라이브러리 itertools.permutations itertools.permutations 함수는 itertools.permutations(iterable, r) 의 형태로 작성되어 사용되는데… 72. 파이썬 표준 라이브러리 itertools.permutations itertools.combinations