Challenge: Store Revenue Analysis
Tâche
Swipe to start coding
You are given a data frame store that contains information on items, their prices, and the quantities sold in a small furniture shop:
| 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.
Solution
Tout était clair ?
Merci pour vos commentaires !
Section 1. Chapitre 40
single
Demandez à l'IA
Demandez à l'IA
Posez n'importe quelle question ou essayez l'une des questions suggérées pour commencer notre discussion
Génial!
Completion taux amélioré à 2.27
Challenge: Store Revenue Analysis
Glissez pour afficher le menu
Tâche
Swipe to start coding
You are given a data frame store that contains information on items, their prices, and the quantities sold in a small furniture shop:
| 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.
Solution
Tout était clair ?
Merci pour vos commentaires !
Section 1. Chapitre 40
single