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!
df.columns.str.matchis the thing you are looking for.df.col. +tabwill not give anything since there is nothing likedf.col.(col is not an attribute of dataframe).colis one of the columns in thedf, so thatdf.colis a series. But anyways,df.columns.str.matc + tabstill does not autocomplete. the problem remainscolcontains string values like 'abc', 'def' or in other words, it's type is object, thendf.col.str.mat + tabwill work. But ifcolhas integer or float values (type is int or float), thendf.col.str.mat + tabwill not autocomplete. You can convert it tox = df.col.astype('str')and then tryx.str.mat + tab, it should work.0.19.2. check your version. And I hope that you are runningdf.Name.st.mat+ TAB in a NEW CELL after initializing df.