mzrandom
mzmttks's blog for my memorandum の略で mzrandum. Topics are: python, book review, and my hobbies.
ページ
(移動先: ...)
自己紹介
▼
2010年11月24日水曜日
python: 配列の最頻値 (mode) を求める。
import scipy
x = scipy.array(x)
list(set(x))[scipy.array([ len( scipy.where(x==key)[0] ) for key in set(x)]).argmax()]
0 件のコメント:
コメントを投稿
‹
›
ホーム
ウェブ バージョンを表示
0 件のコメント:
コメントを投稿