PythonCall.jl README

The project's README from github.com/JuliaPy/PythonCall.jl. As one markdown file: README.md.

PythonCall.jl logo
PythonCall & JuliaCall

Project Status: Active – The project has reached a stable, usable state and is being actively developed. Stable Documentation Dev Documentation Tests Codecov PkgEval

Bringing Python® and Julia together in seamless harmony:

⭐ If you like this, a GitHub star would be lovely thank you. ⭐

To get started, read the documentation.

Example 1: Calling Python from Julia

In this example, we use the Julia module PythonCall from a Pluto notebook to inspect the Iris dataset:

Seaborn example screenshot

Example 2: Calling Julia from Python

In this example we use the Python module JuliaCall from an IPython notebook to train a simple neural network:

Flux example screenshot

What about PyCall?

The existing package PyCall is another similar interface to Python. Here we note some key differences:.

PythonCall.jl (JuliaPy/PythonCall.jl)

Searching Database…

这是什么?PythonCall.jl(以及其在 Python 侧对应的 JuliaCall)让你通过对称接口从 Julia 调用 Python 代码、从 Python 调用 Julia 代码,并在两种语言之间转换对象。
这是 Julia 库、Python 库,还是两者都是?两者都是:PythonCall 是你安装后用于调用 Python 的 Julia 包,JuliaCall 则是配套的 Python 模块,用于从 Python 调用 Julia。
怎么把它添加到我的项目里?请阅读官方文档入门;README 没有给出内联的安装命令。
我需要单独安装 Python 吗,还是它会替我管理?PythonCall 通过 CondaPkg 把自己的 Python 依赖安装到每个 Julia 项目专属的 Conda 环境中,因此每个项目都会自动获得隔离的 Python 依赖。
它和旧的 PyCall 包有什么区别?与 PyCall 不同,PythonCall 支持更广泛的可扩展转换,默认从不复制可变对象(而是包装它们,因此修改会影响原对象,转换也更快),并且结果保留为 Python 对象,而不是自动转换为 Julia。
支持哪些操作系统和版本组合?它在 Windows、MacOS 和 Linux 上经过测试,要求 64 位系统、Julia 1.10+ 和 Python 3.10+。
能在不复制数据的情况下转换 NumPy 数组吗?可以。bytes、array.array 和 numpy.ndarray 等数值数组可以在 Julia 和 Python 之间无复制转换,两种语言都能就地修改底层数据。
它支持 Pandas DataFrame 吗?支持。它提供辅助包装器,把 Python 数据框解释为 Julia 对应物,反之亦然,例如用 pytable(df) 把 Julia DataFrame 变成 Python Pandas DataFrame。
跨语言出错时的错误信息是什么样?该项目宣传其拥有跨越 Julia/Python 边界的“漂亮堆栈跟踪”,让跨语言调试更清晰。
Creator
JuliaPy
Size
6.9 MB
Stars
1.1K
Age
5y
Commits · 90 Days