Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Recall Loops | Explore Dataset
Introduction to Python for Data Analysis
course content

Conteúdo do Curso

Introduction to Python for Data Analysis

Introduction to Python for Data Analysis

1. Introduction to Python 1/2
2. Introduction to Python 2/2
3. Explore Dataset
4. Becoming an Analyst

Recall Loops

Imagine that you want to count how many 'Data Scientist' jobs are in the dataset. You are already familiar with the loops and if/else statements. Try it.

Tarefa

Follow the algorithm:

  1. Create a for loop that iterates through the 'job_title' column in the df.
  2. Within the for loop, implement the if statement that checks if i is equal to 'Data Scientist'.
  3. Within the if statement, increase the count variable by 1.

Tarefa

Follow the algorithm:

  1. Create a for loop that iterates through the 'job_title' column in the df.
  2. Within the for loop, implement the if statement that checks if i is equal to 'Data Scientist'.
  3. Within the if statement, increase the count variable by 1.

In this chapter, you count values in a straightforward but irrational way. Imagine that you have thousands of rows in the dataset; such a loop may take even an hour to process, depending on the dataset's size and the computer's power. Thus, in the next section, you will learn how to do the same thing but in a way that pandas offer you.

Tudo estava claro?

Seção 3. Capítulo 12
toggle bottom row

Recall Loops

Imagine that you want to count how many 'Data Scientist' jobs are in the dataset. You are already familiar with the loops and if/else statements. Try it.

Tarefa

Follow the algorithm:

  1. Create a for loop that iterates through the 'job_title' column in the df.
  2. Within the for loop, implement the if statement that checks if i is equal to 'Data Scientist'.
  3. Within the if statement, increase the count variable by 1.

Tarefa

Follow the algorithm:

  1. Create a for loop that iterates through the 'job_title' column in the df.
  2. Within the for loop, implement the if statement that checks if i is equal to 'Data Scientist'.
  3. Within the if statement, increase the count variable by 1.

In this chapter, you count values in a straightforward but irrational way. Imagine that you have thousands of rows in the dataset; such a loop may take even an hour to process, depending on the dataset's size and the computer's power. Thus, in the next section, you will learn how to do the same thing but in a way that pandas offer you.

Tudo estava claro?

Seção 3. Capítulo 12
toggle bottom row

Recall Loops

Imagine that you want to count how many 'Data Scientist' jobs are in the dataset. You are already familiar with the loops and if/else statements. Try it.

Tarefa

Follow the algorithm:

  1. Create a for loop that iterates through the 'job_title' column in the df.
  2. Within the for loop, implement the if statement that checks if i is equal to 'Data Scientist'.
  3. Within the if statement, increase the count variable by 1.

Tarefa

Follow the algorithm:

  1. Create a for loop that iterates through the 'job_title' column in the df.
  2. Within the for loop, implement the if statement that checks if i is equal to 'Data Scientist'.
  3. Within the if statement, increase the count variable by 1.

In this chapter, you count values in a straightforward but irrational way. Imagine that you have thousands of rows in the dataset; such a loop may take even an hour to process, depending on the dataset's size and the computer's power. Thus, in the next section, you will learn how to do the same thing but in a way that pandas offer you.

Tudo estava claro?

Imagine that you want to count how many 'Data Scientist' jobs are in the dataset. You are already familiar with the loops and if/else statements. Try it.

Tarefa

Follow the algorithm:

  1. Create a for loop that iterates through the 'job_title' column in the df.
  2. Within the for loop, implement the if statement that checks if i is equal to 'Data Scientist'.
  3. Within the if statement, increase the count variable by 1.

In this chapter, you count values in a straightforward but irrational way. Imagine that you have thousands of rows in the dataset; such a loop may take even an hour to process, depending on the dataset's size and the computer's power. Thus, in the next section, you will learn how to do the same thing but in a way that pandas offer you.

Seção 3. Capítulo 12
Mude para o desktop para praticar no mundo realContinue de onde você está usando uma das opções abaixo
We're sorry to hear that something went wrong. What happened?
some-alt