0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Callableという概念

0
Last updated at Posted at 2026-04-15

結論

  • callable(呼び出し可能)
    • ()を後ろに持ってくることができる
  • Subscritable
    • []を後ろに持ってくることができる

Numpy配列は、SubscritableだがCallableではない

bins = np.arange(0, 1.05, 0.05)

ダメな例

bins(1)
#以下のようなErrorが出力される
TypeError: 'numpy.ndarray' object is not callable
  • ダメな理由:Numpy配列に対して関数()を呼び出そうとした
    良い例
bin_width[1]
#Errorのない出力結果
bin_width[1]
0
0
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
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?