Open schlichtanders opened 1 year ago
I can imagine something like
Base.getindex(o::PyObject, s) = py"$o[$s]"
Base.setindex!(o::PyObject, v, s) = py"$o[$s] = $v"
In the meantime, you can use PythonCall.jl, which supports this.
This is not completely true. PythonCall.jl has indeed difficulties with the mentioned example because of comparisons between python object (series) and julia object ("value"). you need to use the @py
macro if you want this to work with PythonCall.jl to the best of my knowledge.
I rather prefer to use native julia syntax, which is indeed the main reason I am going for PyCall.jl when calling Python from Julia.
Came here to request the same, in fact I would be happy to "just" be able to select rows from a pandas data frame, e.g. df[[1,2]]
to select the first two rows
I am using pandas with PyCall.jl and would like to write something like
looking into the code https://github.com/JuliaPy/PyCall.jl/blob/master/src/PyCall.jl#L349-L361 it seems that this is just not supported currently (because of some legacy where indexing was used instead of dot access)