Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

255
Visualizações
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 Respostas
Responde à pergunta

0

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

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

over 4 years ago · Santiago Trujillo Relatório

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 Relatório

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda