0

我在 yt 中创建派生字段并打印它时遇到问题。请看我的代码:

%matplotlib inline
import yt
import numpy as np
from yt import derived_field
from matplotlib import pylab


@derived_field(name = "C12", units = " ")
def _C12(field, data):
     return data["cell_mass"]*data["c12 "]

ds = yt.load("~/super3d_hdf5_chk_0110")
dd = ds.all_data()
print dd.quantities.keys()
print dd["C12"]

和以下错误:

 File "<string>", line unknown

    ^
SyntaxError: unexpected EOF while parsing

我只是在这里看不到我的错误,有人可以为我指出吗?

4

0 回答 0