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
PyCall has proven invaluable to me -- thanks! -- but I have been unable to use the important .loc() function (handy in locating specific rows and columns of a dataframe) under Pandas.
The following python works to locate two rows and a column:
import pandas as pd
data = {'Name':['Bob', 'Ruth', 'Tina', 'Jack'], 'Age':[30, 25, 18, 31]}
df = pd.DataFrame(data)
df.loc[0:1,"Age"]
But under Julia while using PyCall, the equivalent code fails:
I think we need to define getindex(::PyObject, ...) so that it just works. Until then, you need to use https://github.com/JuliaPy/Pandas.jl or just do py""" .... """.
We will implement getindex eventually, but have been holding off because getindex used to be used for getting attributes in PyCall, before dot overloading. That's why it's currently deprecated. Once enough PyCall-using packages have upgraded, we can switch to making getindex in Julia be equivalent to the Python o[key].
PyCall has proven invaluable to me -- thanks! -- but I have been unable to use the important .loc() function (handy in locating specific rows and columns of a dataframe) under Pandas.
The following python works to locate two rows and a column:
But under Julia while using PyCall, the equivalent code fails:
Thanks for any insight how to work around this issue.
The text was updated successfully, but these errors were encountered: