import numpy as np
A = np.array([])
1. np.argsort(A)
returns indicies in ascending order
2. np.bincount(A)
A: int array
A[1,2,3,1] -> B[0,2,1,1] (B[i]는 A의 원소들 중 i의 개수 0의 개수 0개, 1의 개수 2개...)
3. np.argmax(A)
returns index number that holds the maximum value
if tied, return the smallest index number.
4. np.concatenate
returns concatenated(합쳐진) arrays.
이용된 코드:
https://github.com/blackco66/cs231n/blob/master/assignment1/cs231n/classifiers/k_nearest_neighbor.py
'스터디 > R, Python' 카테고리의 다른 글
[Python] 'self' input in class function (0) | 2018.10.09 |
---|