Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Challenge | Preprocessing Data: Part I
Data Manipulation using pandas
course content

Contenido del Curso

Data Manipulation using pandas

Data Manipulation using pandas

1. Preprocessing Data: Part I
2. Preprocessing Data: Part II
3. Grouping Data
4. Aggregating and Visualizing Data
5. Joining Data

bookChallenge

You've solved the first problem with wrong column type. Let's solve the remaining one (with dots). Recall that there are 4 columns with wrong types left ('morgh', 'valueh', 'grosrth', 'omphtotinch'). These columns considered to have dots as indicators for 'Not applicable'. For instance, columns valueh and grosrth are mutually exclusive, since the first one indicates the price of dwelling (i.e., house is owned) and the second one indicates the monthly rent.

The most appropriate way to solve this problem is to replace dots by NA values. In that case, we would be able to manipulate column like a numerical one.

Tarea
test

Swipe to show code editor

Perform a replacement of dot symbols . by NAs for 'morgh', 'valueh', 'grosrth', 'omphtotinch' columns. Follow the next steps:

  1. Import the NumPy library with np alias.
  2. Apply the .where() method to the df dataframe.
  3. Set the condition what values must remain unchanged. These must be non-dots values.
  4. Set the other parameter to nan value from NumPy.

Switch to desktopCambia al escritorio para practicar en el mundo realContinúe desde donde se encuentra utilizando una de las siguientes opciones
¿Todo estuvo claro?

¿Cómo podemos mejorarlo?

¡Gracias por tus comentarios!

Sección 1. Capítulo 8
toggle bottom row

bookChallenge

You've solved the first problem with wrong column type. Let's solve the remaining one (with dots). Recall that there are 4 columns with wrong types left ('morgh', 'valueh', 'grosrth', 'omphtotinch'). These columns considered to have dots as indicators for 'Not applicable'. For instance, columns valueh and grosrth are mutually exclusive, since the first one indicates the price of dwelling (i.e., house is owned) and the second one indicates the monthly rent.

The most appropriate way to solve this problem is to replace dots by NA values. In that case, we would be able to manipulate column like a numerical one.

Tarea
test

Swipe to show code editor

Perform a replacement of dot symbols . by NAs for 'morgh', 'valueh', 'grosrth', 'omphtotinch' columns. Follow the next steps:

  1. Import the NumPy library with np alias.
  2. Apply the .where() method to the df dataframe.
  3. Set the condition what values must remain unchanged. These must be non-dots values.
  4. Set the other parameter to nan value from NumPy.

Switch to desktopCambia al escritorio para practicar en el mundo realContinúe desde donde se encuentra utilizando una de las siguientes opciones
¿Todo estuvo claro?

¿Cómo podemos mejorarlo?

¡Gracias por tus comentarios!

Sección 1. Capítulo 8
toggle bottom row

bookChallenge

You've solved the first problem with wrong column type. Let's solve the remaining one (with dots). Recall that there are 4 columns with wrong types left ('morgh', 'valueh', 'grosrth', 'omphtotinch'). These columns considered to have dots as indicators for 'Not applicable'. For instance, columns valueh and grosrth are mutually exclusive, since the first one indicates the price of dwelling (i.e., house is owned) and the second one indicates the monthly rent.

The most appropriate way to solve this problem is to replace dots by NA values. In that case, we would be able to manipulate column like a numerical one.

Tarea
test

Swipe to show code editor

Perform a replacement of dot symbols . by NAs for 'morgh', 'valueh', 'grosrth', 'omphtotinch' columns. Follow the next steps:

  1. Import the NumPy library with np alias.
  2. Apply the .where() method to the df dataframe.
  3. Set the condition what values must remain unchanged. These must be non-dots values.
  4. Set the other parameter to nan value from NumPy.

Switch to desktopCambia al escritorio para practicar en el mundo realContinúe desde donde se encuentra utilizando una de las siguientes opciones
¿Todo estuvo claro?

¿Cómo podemos mejorarlo?

¡Gracias por tus comentarios!

You've solved the first problem with wrong column type. Let's solve the remaining one (with dots). Recall that there are 4 columns with wrong types left ('morgh', 'valueh', 'grosrth', 'omphtotinch'). These columns considered to have dots as indicators for 'Not applicable'. For instance, columns valueh and grosrth are mutually exclusive, since the first one indicates the price of dwelling (i.e., house is owned) and the second one indicates the monthly rent.

The most appropriate way to solve this problem is to replace dots by NA values. In that case, we would be able to manipulate column like a numerical one.

Tarea
test

Swipe to show code editor

Perform a replacement of dot symbols . by NAs for 'morgh', 'valueh', 'grosrth', 'omphtotinch' columns. Follow the next steps:

  1. Import the NumPy library with np alias.
  2. Apply the .where() method to the df dataframe.
  3. Set the condition what values must remain unchanged. These must be non-dots values.
  4. Set the other parameter to nan value from NumPy.

Switch to desktopCambia al escritorio para practicar en el mundo realContinúe desde donde se encuentra utilizando una de las siguientes opciones
Sección 1. Capítulo 8
Switch to desktopCambia al escritorio para practicar en el mundo realContinúe desde donde se encuentra utilizando una de las siguientes opciones
We're sorry to hear that something went wrong. What happened?
some-alt