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

Зміст курсу

Analyzing and Visualizing Real-World Data

Analyzing and Visualizing Real-World Data

1. Preprocessing Data: Part I
2. Preprocessing Data: Part II
3. Analyzing Data
4. Visualizing Data

Replacing Characters

Just as we removed characters, there are also two ways to perform replacements: either by using the .str accessor or by using a lambda function. Since we are only performing the replacement for one column, let's use the first approach.

Завдання

  1. Replace the commas with dots in the 'CPI' column. Follow these steps:
    • Select the 'CPI' column;
    • Use the .str accessor;
    • Replace the ',' symbols with '.' using the .replace() method;
    • Convert the values to float type;
    • Assign the obtained result to the 'CPI' column.
  2. Display the first row of the df dataframe and data types of the df dataframe.

Завдання

  1. Replace the commas with dots in the 'CPI' column. Follow these steps:
    • Select the 'CPI' column;
    • Use the .str accessor;
    • Replace the ',' symbols with '.' using the .replace() method;
    • Convert the values to float type;
    • Assign the obtained result to the 'CPI' column.
  2. Display the first row of the df dataframe and data types of the df dataframe.

Перейдіть на комп'ютер для реальної практикиПродовжуйте з того місця, де ви зупинились, використовуючи один з наведених нижче варіантів

Все було зрозуміло?

Секція 1. Розділ 7
toggle bottom row

Replacing Characters

Just as we removed characters, there are also two ways to perform replacements: either by using the .str accessor or by using a lambda function. Since we are only performing the replacement for one column, let's use the first approach.

Завдання

  1. Replace the commas with dots in the 'CPI' column. Follow these steps:
    • Select the 'CPI' column;
    • Use the .str accessor;
    • Replace the ',' symbols with '.' using the .replace() method;
    • Convert the values to float type;
    • Assign the obtained result to the 'CPI' column.
  2. Display the first row of the df dataframe and data types of the df dataframe.

Завдання

  1. Replace the commas with dots in the 'CPI' column. Follow these steps:
    • Select the 'CPI' column;
    • Use the .str accessor;
    • Replace the ',' symbols with '.' using the .replace() method;
    • Convert the values to float type;
    • Assign the obtained result to the 'CPI' column.
  2. Display the first row of the df dataframe and data types of the df dataframe.

Перейдіть на комп'ютер для реальної практикиПродовжуйте з того місця, де ви зупинились, використовуючи один з наведених нижче варіантів

Все було зрозуміло?

Секція 1. Розділ 7
toggle bottom row

Replacing Characters

Just as we removed characters, there are also two ways to perform replacements: either by using the .str accessor or by using a lambda function. Since we are only performing the replacement for one column, let's use the first approach.

Завдання

  1. Replace the commas with dots in the 'CPI' column. Follow these steps:
    • Select the 'CPI' column;
    • Use the .str accessor;
    • Replace the ',' symbols with '.' using the .replace() method;
    • Convert the values to float type;
    • Assign the obtained result to the 'CPI' column.
  2. Display the first row of the df dataframe and data types of the df dataframe.

Завдання

  1. Replace the commas with dots in the 'CPI' column. Follow these steps:
    • Select the 'CPI' column;
    • Use the .str accessor;
    • Replace the ',' symbols with '.' using the .replace() method;
    • Convert the values to float type;
    • Assign the obtained result to the 'CPI' column.
  2. Display the first row of the df dataframe and data types of the df dataframe.

Перейдіть на комп'ютер для реальної практикиПродовжуйте з того місця, де ви зупинились, використовуючи один з наведених нижче варіантів

Все було зрозуміло?

Just as we removed characters, there are also two ways to perform replacements: either by using the .str accessor or by using a lambda function. Since we are only performing the replacement for one column, let's use the first approach.

Завдання

  1. Replace the commas with dots in the 'CPI' column. Follow these steps:
    • Select the 'CPI' column;
    • Use the .str accessor;
    • Replace the ',' symbols with '.' using the .replace() method;
    • Convert the values to float type;
    • Assign the obtained result to the 'CPI' column.
  2. Display the first row of the df dataframe and data types of the df dataframe.

Перейдіть на комп'ютер для реальної практикиПродовжуйте з того місця, де ви зупинились, використовуючи один з наведених нижче варіантів
Секція 1. Розділ 7
Перейдіть на комп'ютер для реальної практикиПродовжуйте з того місця, де ви зупинились, використовуючи один з наведених нижче варіантів
We're sorry to hear that something went wrong. What happened?
some-alt