Hi,
I imported pandas and read CSV, I can print the data. I want to select the first 3 columns, it is working in Python as df.iloc[:,:3] but didn’t work in Julia. I also tried df[[“col1”,“col2”,“col3”]].
Any suggestion, I don’t want to add other libraries.
I don’t know enough about either pandas or pycall to help you with this, unfortunately. Hopefully someone with more domain knowledge can help. Note that you still have :3 instead of 0:3, which may be causing an issue but I think is unlikely to be the main problem.
Thanks a lot, @jling, works amazingly!.
Can you please just add a short explanation?
Why do I need to use get?
I have different Pythonic libraries I want to use!
basically it’s because various overload in python such that you need to go a bit low-level.
iloc under the hood isn’t a simple function call because it’s the iloc tied to a PyObject so you can’t get the df.iloc first (at that point the pandas magic won’t work). So you need to manually use get( to tell PyCall those two arguments need to go inside df.iloc in python, not in julia.