クラスの開発中にこのエラーが発生しました。Python - IndentationError:インデントブロックが予想される(クラスに関連する珍しいインデントエラー)
from __future__ import division
import numpy as np
import scipy as sp
import itertools as it
from scipy.integrate import quad
import astropy.cosmology
from astropy import units as u
class NFW:
File "/Users/alexandres/Illustris/Scripts/NFWprofile2.py", line 10
^
IndentationError: expected an indented block
[Finished in 0.1s with exit code 1]
[shell_cmd: python -u "/Users/alexandres/Illustris/Scripts/NFWprofile2.py"]
[dir: /Users/alexandres/Illustris/Scripts]
[path: /usr/bin:/bin:/usr/sbin:/sbin]
これはどのようにインデントエラーですか?
私がクラスをNFW()
またはNFW(object)
と定義しても、これは発生しています。
これは、それはあなたの全体のファイルである場合は、クラスの必要な身体を欠けている崇高3を通じて
classステートメントの行の後ろは何ですか? –
クラスの本体がどこにあるインデントされたブロックが必要ですが、それはどこにも見つかりません... – Li357