0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

numpyの地味に知らなかった便利機能

Posted at

今まで地味に知らなかったnumpyの便利な機能があったらメモっとく備忘録。
無知の知。。。

cumsum()

numpy配列を足し込んでいく。

>>> numpy_numbers = np.arange(10)
>>> numpy_numbers.cumsum()
array([ 0,  1,  3,  6, 10, 15, 21, 28, 36, 45])
>>> np.cumsum(numpy_numbers)
array([ 0,  1,  3,  6, 10, 15, 21, 28, 36, 45])
0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?