Maxim
Maxim

Reputation: 756

Is there a way to get ipython autocompletion when piping a pandas dataframe to a function?

For example, if I have a pipe function:

def process_data(weighting, period, threshold):
    # do stuff

Can I get autocompletion on the process data arguments?

There are a lot of arguments to remember and I would like to make sure they get passed in correctly. In ipython, the function can autocomplete to show me the keyword args which is really neat, but I would like it to do this when piping a pandas dataframe too!

enter image description here

enter image description here

I don't see how this would be possible, but then again, I'm truly in awe of ipython and all its greatness. So, is this possible? If not, are there other hacks that people have come up with?

Upvotes: 0

Views: 105

Answers (1)

dedede
dedede

Reputation: 347

Install the pyreadline library.

$ pip install pyreadline

Update:

It seems like this problem is specific to some versions of ipython. The solution is the following: Run below command from the terminal:

$ ipython profile create

It will create a default profile at ~/.ipython/profile_default/ipython_config.py

Now edit this ipython_config.py and add the below lines and it will solve the issue.

c = get_config()
c.Completer.use_jedi = False

Reference:

Upvotes: 0

Related Questions