I am having a problem similar to this user: when calling autocomplete on df.col.
, I get no autocompletion even after evaluating a cell containing only df.col
. For instance, I'd like to see df.col.str.matc
to autocomplete to df.col.str.match
. What can I do to solve this?
Take as example the following dataframe:
import pandas as pd
data = [['Alex in FL','ten'],['Bob in FLORIDA','five'],['Will in GA','three']]
df = pd.DataFrame(data,columns=['Name','Age'])
#Dataframe:
Name Age
0 Alex in FL ten
1 Bob in FLORIDA five
2 Will in GA three
#Command that should autocomplete (but does not):
df.Name.str.matc [+TAB]
I do not want to try hinterland since I only want autocomplete upon pressing tab.
Thanks a lot in advance!
Enable autocomplete featureTo enable code autocomplete in Jupyter Notebook or JupyterLab, you just need to hit the Tab key while writing code. Jupyter will suggest a few completion options. Navigate to the one you want with the arrow keys, and hit Enter to choose the suggestion.
In JupyterLab, create a new (Python 3) notebook: In the first cell of the notebook, you can import pandas and check the version with: Now you are ready to use pandas, and you can write your code in the next cells.
After reading this, it seems that this problem is faced by other people and with specific version of ipython. The solution is also given on that link.
It is like this:
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:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With