Comece agoraComece grátis

Creating new columns with a suffix

You are asked by a client how each vehicle ranks relative to the others in terms of their performance characteristics such as their acceleration or range.

Este exercicio faz parte do curso

Introduction to Polars

Ver curso

Instruções do exercicio

  • Use selectors to select all of the string and float columns in a new DataFrame rank_df.
  • Add new columns with the rank of the float columns with the suffix "_rank" added to the column name.

exercicio interativo prático

Tente este exercicio completando este código de exemplo.

rank_df = (
    ev_df
	# Select all string and float columns  
    .select(____)
	# Add new columns with the rank of the float columns
    .with_columns(____)
)

print(rank_df)
Editar e Executar Código