ITADN

Python to Julia dataframe conversion broken by `pandas v3.0`

#745Closedsstroemer 创建于 2026-02-02
bug
S
sstroemercommented
**Affects:** Both Using `pandas` version `3.0.0` the `pd.DataFrame` to `DataFrames.DataFrame` conversion is broken. The following snippet ```python df = pd.DataFrame({ "foo": [1, 2, 3], "bar": [4, 5, 6], }) jl.DataFrames.DataFrame(df) ``` results in ```console juliacall.JuliaError: ArgumentError: 'PyIterable{Any}' iterates 'String' values, which doesn't satisfy the Tables.jl `AbstractRow` interface Stacktrace: [1] invalidtable(::PyIterable{Any}, ::String) @ Tables ~/.julia/packages/Tables/cRTb7/src/tofromdatavalues.jl:41 [2] iterate @ ~/.julia/packages/Tables/cRTb7/src/tofromdatavalues.jl:47 [inlined] [3] buildcolumns @ ~/.julia/packages/Tables/cRTb7/src/fallbacks.jl:209 [inlined] [4] _columns @ ~/.julia/packages/Tables/cRTb7/src/fallbacks.jl:274 [inlined] [5] columns @ ~/.julia/packages/Tables/cRTb7/src/fallbacks.jl:258 [inlined] [6] DataFrames.DataFrame(x::PyIterable{Any}; copycols::Nothing) @ DataFrames ~/.julia/packages/DataFrames/b4w9K/src/other/tables.jl:57 [7] DataFrames.DataFrame(x::PyIterable{Any}) @ DataFrames ~/.julia/packages/DataFrames/b4w9K/src/other/tables.jl:48 [8] pyjlany_call(self::Type{DataFrames.DataFrame}, args_::Py, kwargs_::Py) @ PythonCall.JlWrap ~/.julia/packages/PythonCall/mkWc2/src/JlWrap/any.jl:47 [9] _pyjl_callmethod(f::Any, self_::Ptr{PythonCall.C.PyObject}, args_::Ptr{PythonCall.C.PyObject}, nargs::Int64) @ PythonCall.JlWrap ~/.julia/packages/PythonCall/mkWc2/src/JlWrap/base.jl:71 [10] _pyjl_callmethod(o::Ptr{PythonCall.C.PyObject}, args::Ptr{PythonCall.C.PyObject}) @ PythonCall.JlWrap.Cjl ~/.julia/packages/PythonCall/mkWc2/src/JlWrap/C.jl:63 ```
关闭于 2026-02-07 0 条评论