Closed schlichtanders closed 1 year ago
I found the following workaround by casting two times to dict
pd.DataFrame(dict(jl.Dict(jl.pairs(jl.eachcol(jl.df2)))))
at least it is still kind of a one liner :smile:
PythonCall has a function for this: jl.pytable
.
Impressive, I was thinking this works exactly the opposite way. I looked through many discourse issues and rescanned the docs, but I didn't come about this. Thank you for the link! I see now that I was looking into the wrong part of the documentation - I was just inspecting the Python side and the Julia side, but haven't looked for an extra compatibility page.
I think PyTable
is listed on the PythonCall subpage, but pytable
is yet not listed on the JuliaCall subpage. It would be great to be added there so that people can find it in the reference their by searching for pandas
or DataFrame
I am running into the very same problem if I want to send a Julia Dict to python
pandas works weird with JuliaDict wrapper, hence I would really like to understand what is the recommended way to transform a julia dict to a python dict. (couldn't find it so far)
pydict
🙂
that makes a lot of sense - thank you
let me summarize how I understood PythonCall/JuliaCall:
pytable
or pydict
)
That sounds about right. I'm always happy to take PRs for improvements to the docs if you think something can be clearer.
Affects: JuliaCall
Describe the bug
I get the error
JuliaError: MethodError: no method matching iterate(::Symbol)
which also happens when just iterating over the pairs iterator from python. Here the example from Python:raises
Your system Please provide detailed information about your system: