You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Indeed this is one of the breaking changes in v0.9 (see point 4 here). You should do c = DataFrame(PyTable(b)) or c = DataFrame(PyPandasDataFrame(b)) instead.
This change is to make the behaviour of Python tables more consistent with the rest of the PythonCall API: a Python int is not considered a Julia Integer, and a Python list is not a Julia AbstractVector, so a Python table is not a Julia table. You use wrapper types (such as PyList or PyTable) or pyconvert to get objects satisfying Julia interfaces.
The fact you get that odd 2x80 DataFrame is due to the fact that Tables.columns(x) falls back to iterating over x, treating each item as a row, and treating its properties as columns. In the case of pandas dataframes, iteration returns the column names, so you get two rows (from the two columns "A" and "B" of the input) and the columns are the attributes of str!
Converting from a julia DataFrame to a pytable then back to a DataFrame works as expected on PythonCall v0.8.
However, with v0.9,
c
is a 2x80 DataFrame with columns with names such as"__eq__" "capitalize" "format" "rsplit" "__contains__""__iter__" "__new__"
.The text was updated successfully, but these errors were encountered: