Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Aprenda Removing and Replacing | Preprocessing Data: Part II
Analyzing and Visualizing Real-World Data

Deslize para mostrar o menu

book
Removing and Replacing

As mentioned previously, there are two ways to perform removing or replacing operations. Since we used the .str accessor two chapters ago, let's use a lambda function this time.

Tarefa

Swipe to start coding

  1. Define a lambda function with a single argument x that will:

    • Remove the '$' characters starting from the left (using the .lstrip() method);

    • Replace all blank spaces (' ') with empty strings ('') (using the .replace() method);

    • Assign the function to the rmv_rpl variable.

  2. Apply the rmv_rpl function to the 'Weekly_Sales' column using the .apply() method and convert it to the float data type.

Solução

Switch to desktopMude para o desktop para praticar no mundo realContinue de onde você está usando uma das opções abaixo
Tudo estava claro?

Como podemos melhorá-lo?

Obrigado pelo seu feedback!

Seção 2. Capítulo 2
single

single

Pergunte à IA

expand

Pergunte à IA

ChatGPT

Pergunte o que quiser ou experimente uma das perguntas sugeridas para iniciar nosso bate-papo

close

Awesome!

Completion rate improved to 3.45

book
Removing and Replacing

As mentioned previously, there are two ways to perform removing or replacing operations. Since we used the .str accessor two chapters ago, let's use a lambda function this time.

Tarefa

Swipe to start coding

  1. Define a lambda function with a single argument x that will:

    • Remove the '$' characters starting from the left (using the .lstrip() method);

    • Replace all blank spaces (' ') with empty strings ('') (using the .replace() method);

    • Assign the function to the rmv_rpl variable.

  2. Apply the rmv_rpl function to the 'Weekly_Sales' column using the .apply() method and convert it to the float data type.

Solução

Switch to desktopMude para o desktop para praticar no mundo realContinue de onde você está usando uma das opções abaixo
Tudo estava claro?

Como podemos melhorá-lo?

Obrigado pelo seu feedback!

close

Awesome!

Completion rate improved to 3.45

Deslize para mostrar o menu

some-alt