배열의 분위수를 구하는 쉽고 빠른 방법은 우선 배열을 정렬한 후 특정 분위의 값을 선택하는
것이다.
In
[
203
]:
large
_
arr
=
np
.
random
.
randn
(
1000
)
In
[
204
]:
large
_
arr
.
sort
()
In
[
205
]:
large
_
arr
[
int
(
0
.
05
*
len
(
large
_
arr
))]
#
5
%
분위수
Out
[
205
]:
-
1
.
5311513550102103
NumPy
의 정렬 메서드에 관한 자세한 내용과 간접 정렬 같은 고급 기법은 부록
A
를 참조하
자. 정렬과 관련된 다른 여러 가지 데이터 처리(표 형식의 데이터를 하나 이상의 열로 정렬하
기 같은) 내용은
pandas
에서 다룬다.
4.3.5
집합 관련 함수
NumPy
는
1
차원
ndarray
를 위한 몇 가지 기본적인 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month, and much more.