Curriculum
Course: Data Science Bootcamp- Bridging the Skil...
Login
Text lesson

1. NumPy For Python Statistical Analysis

Objective: Master NumPy arrays and statistical operations for efficient data analysis in Python.


1. Introduction to NumPy

Key Concepts:

  • Why NumPy?: Fast numerical computations on arrays/matrices.

  • Core Features:

    • Multidimensional arrays (ndarray).

    • Vectorized operations (no loops needed).

  •  


2. Creating NumPy Arrays

Methods Covered:

  • From Lists/Tuples:

  • Special Arrays:

    • np.zeros((3,3)): 3×3 array of 0s.

    • np.ones((2,2)): 2×2 array of 1s.

    • np.random.rand(2,2): Random values (0–1).

Data Types:

  • Specify with dtype (e.g., int, float, bool).

  • Convert types: .astype('float').


3. Array Attributes & Operations

Key Attributes:

  • shape: Dimensions (e.g., (3,3) for a 3×3 matrix).

  • size: Total elements.

  • dtype: Data type.

Mathematical Operations:

  • Element-wise: +, -, *, /, **.

  • Aggregations: .sum(), .mean(), .max().

 

4. Indexing & Slicing

Techniques:

  • 1D Arrays: arr[0], arr[1:3].

  • 2D Arrays: arr[0,1] (row 0, column 1).

  • Boolean Indexing: arr[arr > 3].

Reshaping:

  • arr.reshape(2,3): Convert 1D to 2D.

  • arr.flatten(): Convert to 1D.


5. Statistical Functions

Essential Functions:

  • Central Tendency:

    • np.mean(), np.median().

  • Spread:

    • np.std() (standard deviation), np.var() (variance).

  • Percentiles: np.percentile(arr, 50) (median).

Random Distributions:

  • Normal: np.random.normal(mean, std, size).

  • Uniform: np.random.rand(size).

 

6. Linear Algebra with NumPy

Key Operations:

  • Dot Product: np.dot(a, b) or a @ b.

  • Matrix Multiplication: np.matmul(a, b).

  • Determinant: np.linalg.det(matrix).


7. Practical Applications

Use Cases:

  • Data Cleaning: Handle missing values (np.nan).

  • Simulations: Generate random data (e.g., Monte Carlo).

  • Visualization: Plot histograms with matplotlib.

Access the full lesson here: NumPy For Statistical Analysis.

 

 

Review Your Cart
0
Add Coupon Code
Subtotal