Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

259
Views
How to print row x without knowing the index in pandas

I have a Dataframe with 45 columns and 11k rows. This dataframe consist of players. Columns displaying their name, player_id, rating, height etc. Pretend you have the name of a player in the dataframe, or their ID, and you want to access the entire row of that player. You want to see all the information of that individual, but you only have one unique identifyer.

I tried using df.loc[[id_number]], but that only takes me to the index of the dataframe, which does not correspond to player_id.

Hopefully I explained it well enough. If you have any questions, please post them below.

over 4 years ago · Santiago Trujillo
3 answers
Answer question

0

df.loc[df['column_name'] == some_value]

Related to https://stackoverflow.com/a/17071908/17487637

over 4 years ago · Santiago Trujillo Report

0

You can try applying a mask:

df[df.playerId == id_number]

Assuming playerId is the name of the column containing the player ids.

over 4 years ago · Santiago Trujillo Report

0

As far as I have understood, you want to query a dataframe based on one unique identifier. Let's suppose you only have player name.

df[df.player_name==playername]

Here playername is the variable where you will store your desired player name.

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!