我遇到了在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
我在这里看不到我的错误,有人可以为我指出这个吗?