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
セクション 3.  12
single

single

bookRecall 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.

タスク

スワイプしてコーディングを開始

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.

Switch to desktop実践的な練習のためにデスクトップに切り替える下記のオプションのいずれかを利用して、現在の場所から続行する
すべて明確でしたか?

どのように改善できますか?

フィードバックありがとうございます!

セクション 3.  12
single

single

AIに質問する

expand

AIに質問する

ChatGPT

何でも質問するか、提案された質問の1つを試してチャットを始めてください

some-alt