Calculate Vector Norms Using np.linalg.norm()
📖 Scenario: Imagine you are working with a delivery company that tracks the movement of packages in 3D space. You want to calculate how far each package has moved from the origin point (0,0,0) using vector norms.
🎯 Goal: You will create a list of 3D vectors representing package movements, set a norm order, calculate the norms of each vector using np.linalg.norm(), and print the results.
📋 What You'll Learn
Create a list of 3D vectors using numpy arrays with exact values
Set a variable for the norm order (e.g., 2 for Euclidean norm)
Use a for loop to calculate the norm of each vector using np.linalg.norm() with the given order
Print the list of calculated norms
💡 Why This Matters
🌍 Real World
Calculating vector norms is useful in physics to find distances or magnitudes, in machine learning to measure errors or distances between points, and in computer graphics to calculate lengths and directions.
💼 Career
Data scientists and engineers often use vector norms to preprocess data, evaluate models, and analyze spatial data.
Progress0 / 4 steps