在Dobson和Barneet撰写的“广义线性模型入门-第三版”一书中,第161页(数据库在此处[bit.ly/2NtJFAw]);我正在尝试复制一些结果,但是估计的符号相反,并且它们的值相同。
in_oval = Oval.contains_point(ax.transData.transform(([px, py])), 0)
请注意,我的估计与之相反。我怀疑这些是重新参数化的值,但是我看不到Studies/Datasets/codes/untitled4.py", line 73, in <module>
in_oval = Oval.contains_point(ax.transData.transform(([px, py])), 0)
File "/Users/jeremyalexander/anaconda/lib/python3.6/site-packages/matplotlib/patches.py", line 154, in contains_point
radius)
File "/Users/jeremyalexander/anaconda/lib/python3.6/site-packages/matplotlib/path.py", line 493, in contains_point
return _path.point_in_path(point[0], point[1], radius, self, transform)
TypeError: only length-1 arrays can be converted to Python scalars
进行确认。任何想法?