cython在jupyter笔记本中 [英] cython in jupyter notebook
本文介绍了cython在jupyter笔记本中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在Jupyter Notebook中加载Cython文件时出现错误.有什么想法吗?
I am getting errors when loading a Cython file in Jupyter Notebook. Any ideas?
%load_ext Cython
import numpy as np
cimport numpy as np
import cython
只是一个简单的错误消息:
Just a simple error message:
File "<ipython-input-3-7e39dc7f561b>", line 5
cimport numpy as np
^
SyntaxError: invalid syntax
推荐答案
After reading the docs -- I used two separate cells. The first one is just:
%load_ext Cython
然后我的导入语句
%%cython
import numpy as np
cimport numpy as np
import cython
这篇关于cython在jupyter笔记本中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文