本文介绍了在Jython中使用NumPy和Cpython的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

必须使用商业Java库,并希望从Python中完成。 Jython很强大,我很好,因为它背后有一些点发布。但是,我希望也使用NumPy,这显然不适用于Jython。 和Java数字库等选项没有吸引力。前者基本上死了。后者大多不成熟,缺乏易用性和广泛接受NumPy。我的问题是:如何让Jython和Python代码互操作?我可以接受从Cpython或其他方式调用Jython。

I must use a commercial Java library, and would like to do it from Python. Jython is robust and I am fine with it being a few dot releases behind. However, I would like to use NumPy as well, which obviously does not work with Jython. Options like CPype and Java numeric libraries are unappealing. The former is essentially dead. The latter are mostly immature and lack the ease of use and wide acceptance of NumPy. My question is: How can one have Jython and Python code interoperate? It would be acceptable for me to call Jython from Cpython or the other way around.

推荐答案

具有讽刺意味的是,考虑到Jython和Numeric(NumPy的祖先)是由同一个开发者发起的(Jim Hugunin,然后他搬了on还发起了IronPython,现在在微软担任某种高级架构师职位,致力于支持.NET和Silverlight的所有动态语言),在Jython中没有非常好的方式使用numpy 。我所知道的最接近的是jnumerical项目 - (稀缺)文档在,但更新的来源是。

It's ironic, considering that Jython and Numeric (NumPy's ancestor) were initiated by the same developer (Jim Hugunin, who then moved on to also initiate IronPython and now holds some kind of senior architect position at Microsoft, working on all kind of dynamic languages support for .NET and Silverlight), that there's no really good way to use numpy in Jython. The closest thing to that, which I know of, is the "jnumerical" project -- the (scarce) docs are on sourceforge, but the updated sources are on bitbucket.

数字Python,jnumerical实现的,不像它的numpy后代那样光滑和流线型,但它具有相同的功能并且分享了许多概念和哲学,所以也许你可以发现它很有用 - 至少值得一试。

"Numeric Python", what jnumerical implements, is not as slick and streamlined as its numpy descendant, but it has about the same functionality and shares a lot of the concepts and philosophy, so maybe you could find it usable -- worth checking out, at least.

这篇关于在Jython中使用NumPy和Cpython的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-16 06:49