python - 如何使用pybind11返回一个DataFrame?

标签 python c++ pybind11

我正在使用 pybind11 编写 Python 模块和 Modern C++ .
如何将 DataFrame 从 C++ 返回到 Python?

最佳答案

可以通过返回 Apache Arrow表,可以通过一行 Python 转换为 Python DataFrame。
有关使用此功能的现有 Python 库的示例:

  • Turbodbc docs .
  • Turbodbc github reposource code with methods to pass tables from C++ to Python using pybind11 .

  • 其他链接
  • How to convert PyArrow table to Arrow table when interfacing between PyArrow in python and Arrow in C++
  • 关于python - 如何使用pybind11返回一个DataFrame?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63033981/

    相关文章:

    python - 如何使用经过训练的 Keras GRU 模型预测新的数据系列?

    python - 在 Python 中比较 2 个 DataFrame 时出现问题,应排除所有重复项,但工作不正常

    c++ - 枚举类运算符的实现

    c++ - pyarrow 表到 PyObject* 通过 pybind11

    c++17 - Python 绑定(bind)使用 pybind11 和 std::filesystem 作为函数参数给出 TypeError

    python - 为什么16位到8位转换会产生条纹图像?

    python - 如何在 python 中弹出子列表的内容?

    c++ - CUDA-CUBLAS : issues solving many (3x3) dense linear systems

    c++ - 连接两个程序,一个使用 main(),一个使用 WinMain()

    python - 在 python 中使用 C++ 对象与 pybind11