SyntaxFix
Write A Post
Hire A Developer
Questions
df.index[df.LastName == 'Smith']
Or
df.query('LastName == "Smith"').index
Will return all row indices where LastName is Smith
LastName
Smith
Int64Index([1], dtype='int64')