Request a Call Back

How to find index of element in dataframe Python ?


Hi. I possess a pandas dataframe and I am seeking to identify the index of a specific entry within it.

Name Age
0 Mike 23
1 Eric 25
2 Donna 23
3 Will 23  

This is the dataframe. I want to find the index of Donna. How can I do it?


   2021-06-14 in Python by Nicholas | 283,015 Views



Write a Comment

Your email address will not be published. Required fields are marked (*)



All answers to this question.


First, use the dataframe to match the value, and then find the index. Try this:

print(df[df[Name]==Donna].index.values)

   Answered 2021-08-20 by Hemant

  • find positions of a single value in a dataframe

       Commented 2021-07-18 by Girish

  • It worked. Thanks

       Commented 2021-08-19 by Yeshwant

  • Thanks a lot, this helped me to.

       Commented 2021-09-29 by Narendra


Suggested Questions

How to find index of element in..
Posted 2021-06-14 by iCert Global.
How to download s3 bucket folder?..
Posted 2020-03-16 by iCert Global.
Python AWS Boto3 How do i read..
Posted 2020-03-12 by iCert Global.
How to filter out na in R..
Posted 2020-02-22 by iCert Global.
How to find all the classes of..
Posted 2023-08-11 by iCert Global.
Copying files from host to Docker container..
Posted 2023-08-11 by iCert Global.
how to exit a python script in..
Posted 2022-11-16 by iCert Global.
How to import a jar file in..
Posted 2022-11-16 by iCert Global.

Disclaimer

  • "PMI®", "PMBOK®", "PMP®", "CAPM®" and "PMI-ACP®" are registered marks of the Project Management Institute, Inc.
  • "CSM", "CST" are Registered Trade Marks of The Scrum Alliance, USA.
  • COBIT® is a trademark of ISACA® registered in the United States and other countries.
  • CBAP® and IIBA® are registered trademarks of International Institute of Business Analysis™.

We Accept

We Accept

Follow Us

iCertGlobal facebook icon
iCertGlobal twitter
iCertGlobal linkedin

iCertGlobal Instagram
iCertGlobal twitter
iCertGlobal Youtube

Quick Enquiry Form

watsapp WhatsApp Us  /      +1 (713)-287-1187