First Look at the Data
Welcome to the last section! In the previous section, we investigated that the most profitable week, according to sales data, is the 'pre-Christmas' week, while Christmas week itself is significantly worse.
We want to start with some exploratory analysis: let's see revenues over weeks using matplotlib and seaborn.
Swipe to start coding
- Import the
matplotlib.pyplotwith the aliasplt, andseabornwith the aliassns. - Prepare data for visualization: calculate the total revenue for all shops across weeks. To do it, group the values of the
dfdataframe by the'Date'column, select the'Weekly_Sales'column, calculate total values, and reset indexes. Save the obtained data within thedatavariable. - Initialize a line plot with the
'Date'values on the x-axis,'Weekly_Sales'values on the y-axis, using thedatadataframe. - Display the plot.
Lösung
Danke für Ihr Feedback!
single
Fragen Sie AI
Fragen Sie AI
Fragen Sie alles oder probieren Sie eine der vorgeschlagenen Fragen, um unser Gespräch zu beginnen
Zusammenfassen Sie dieses Kapitel
Code in file erklären
Erklären, warum file die Aufgabe nicht löst
Awesome!
Completion rate improved to 3.45
First Look at the Data
Swipe um das Menü anzuzeigen
Welcome to the last section! In the previous section, we investigated that the most profitable week, according to sales data, is the 'pre-Christmas' week, while Christmas week itself is significantly worse.
We want to start with some exploratory analysis: let's see revenues over weeks using matplotlib and seaborn.
Swipe to start coding
- Import the
matplotlib.pyplotwith the aliasplt, andseabornwith the aliassns. - Prepare data for visualization: calculate the total revenue for all shops across weeks. To do it, group the values of the
dfdataframe by the'Date'column, select the'Weekly_Sales'column, calculate total values, and reset indexes. Save the obtained data within thedatavariable. - Initialize a line plot with the
'Date'values on the x-axis,'Weekly_Sales'values on the y-axis, using thedatadataframe. - Display the plot.
Lösung
Danke für Ihr Feedback!
single