Data Extraction
Finish the section with practice on abstract local furniture store selling data!
Swipe to start coding
You will work with the data below. This data is stored in the store variable.
| Item | Price | Sold |
|---|---|---|
| Sofa | 340 | 67 |
| Armchair | 150 | 81 |
| Dining table | 115 | 79 |
| Bookshelf | 160 | 42 |
| Kitchen Cabinet | 70 | 67 |
Your tasks are:
- Add a new column named
'Revenue'with the revenue of each item (multiply'Price'and'Sold'). To access columns, use the$sign. - Using the
sum()function, calculate the total number of items sold. Save initems_soldvariable and output its value. - Calculate total revenue using
sum()function. Save in thetotal_revenuevariable and output its value. - Find out the average price of the sold item - divide
total_revenuebyitems_sold.
Oplossing
Bedankt voor je feedback!
single
Vraag AI
Vraag AI
Vraag wat u wilt of probeer een van de voorgestelde vragen om onze chat te starten.
Can you provide some sample data for the local furniture store?
What kind of practice exercises would you like to include?
Do you want the practice to focus on data analysis or visualization?
Awesome!
Completion rate improved to 5.56
Data Extraction
Veeg om het menu te tonen
Finish the section with practice on abstract local furniture store selling data!
Swipe to start coding
You will work with the data below. This data is stored in the store variable.
| Item | Price | Sold |
|---|---|---|
| Sofa | 340 | 67 |
| Armchair | 150 | 81 |
| Dining table | 115 | 79 |
| Bookshelf | 160 | 42 |
| Kitchen Cabinet | 70 | 67 |
Your tasks are:
- Add a new column named
'Revenue'with the revenue of each item (multiply'Price'and'Sold'). To access columns, use the$sign. - Using the
sum()function, calculate the total number of items sold. Save initems_soldvariable and output its value. - Calculate total revenue using
sum()function. Save in thetotal_revenuevariable and output its value. - Find out the average price of the sold item - divide
total_revenuebyitems_sold.
Oplossing
Bedankt voor je feedback!
single