作成
TypeError: slice indices must be integers or None or have an __index__ method
###explain 以下のようなソースでエラーがでました。 ###source pylab.plot(fs[0:n/2], a[0:n/2]) ###error TypeError: slice indices must be integers or None or have an __index__ method ### これで治ります。 ###source solve pylab.plot(fs[0:n//2], a[0:n//2]) ###memo 理由は python3では / は実数。 // は整数です。 ###source (Python3 の除算) x = 5/2 #結果 2.5 x = 5//2 #結果 2
wakatta 記法
投稿の仕方
基本的な記法
エンジニア向け記法
記法のサンプル
このコンテンツを見る