shikoan’s memo

プログラミング初心者のチラ裏

ぷろぐらみんぐ帳

2018-04-02から1日間の記事一覧

numpy.ufunc.reduceatの意味

100 Numpy Exercisesの78問目より。この関数意味わからなかった。ちなみにこんな問題。ブロック単位での和を計算することを想定している。 78.Consider a 16x16 array, how to get the block-sum (block size is 4x4)? (★★★) # Author: Robert Kern Z = np.o…

numpy.bincountのweightの意味

100 Numpy Exercisesの56問目で解いていたときにふと湧いた疑問。こんな問題。 56.How to accumulate elements of a vector (X) to an array (F) based on an index list (I)? (★★★) # Author: Alan G Isaac X = [1,2,3,4,5,6] I = [1,3,9,3,4,1] F = np.bin…