Why reshaping arrays matters
📖 Scenario: Imagine you work in a bakery that tracks daily sales of different types of bread. The sales data is collected as a single list of numbers, but you want to organize it by days and bread types to understand patterns better.
🎯 Goal: You will reshape a one-dimensional array of sales data into a two-dimensional array to see daily sales per bread type clearly.
📋 What You'll Learn
Create a NumPy array called
sales with exactly 12 values representing sales.Create a variable called
days and set it to 4.Use the
reshape method on sales to create a new array called daily_sales with shape (days, 3).Print the
daily_sales array to see the reshaped data.💡 Why This Matters
🌍 Real World
Reshaping arrays helps organize raw data into meaningful tables, like daily sales per product, making it easier to analyze and understand.
💼 Career
Data scientists often reshape data to prepare it for analysis, visualization, or machine learning models.
Progress0 / 4 steps