Skip to Content
파이썬 라이브러리를 활용한 데이터 분석(2판): 영화 평점, 이름 통계, 선거 데이터 등 실사례 사용
book

파이썬 라이브러리를 활용한 데이터 분석(2판): 영화 평점, 이름 통계, 선거 데이터 등 실사례 사용

by 김영근, 웨스 맥키니
June 2019
Beginner to intermediate
664 pages
18h 26m
Korean
Hanbit Media, Inc.
Content preview from 파이썬 라이브러리를 활용한 데이터 분석(2판): 영화 평점, 이름 통계, 선거 데이터 등 실사례 사용
606
파이썬 라이브러리를 활용한 데이터 분석(2판)
In
[
103
]:
depth
_
means
Out
[
103
]:
array
([[
-
0
.
4735
,
0
.
3971
,
-
0
.
0228
,
0
.
2001
],
[
-
0
.
3521
,
-
0
.
281
,
-
0
.
071
,
-
0
.
1586
],
[
0
.
6245
,
0
.
6047
,
0
.
4396
,
-
0
.
2846
]])
In
[
104
]:
depth
_
means
.
shape
Out
[
104
]:
(
3
,
4
)
In
[
105
]:
demeaned
=
arr
-
depth
_
means
[:,
:,
np
.
newaxis
]
In
[
106
]:
demeaned
.
mean
(
2
)
Out
[
106
]:
array
([[
0
.,
0
.,
-
0
.,
-
0
.],
[
0
.,
0
.,
-
0
.,
0
.],
[
0
.,
0
.,
-
0
.,
-
0
.]])
몇몇 독자는 성능을 희생하지 않으면서 한 축에 대해 평균값을 빼는 과정을 일반화할 수 없을
지 궁금할 것이다. 사실 방법이 존재하긴 하지만 색인을 이용한 약간의 서커스가 필요하다.
def demean
_
axis
(
arr
,
axis
=
0
):
means
=
arr
.
mean
(
axis
)
#
이렇게
n
차원에
대해서
[:,
:,
np
.
newaxis
]
수행하는
과정을
일반화할
있다
.
indexer
=
[
slice
(
None
)]
*
arr
.
ndim
indexer
[
axis
]
=
np
.
newaxis
return ...
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.
Start your free trial

You might also like

파이썬 라이브러리를 활용한 머신러닝(번역개정판): 사이킷런 핵심 개발자가 쓴 머신러닝과 데이터 과학 실무서

파이썬 라이브러리를 활용한 머신러닝(번역개정판): 사이킷런 핵심 개발자가 쓴 머신러닝과 데이터 과학 실무서

박해선, 안드레아스 뮐러, 세라 가이도

Publisher Resources

ISBN: 9791162241905