Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

7 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

Mean-Variance-Standard Deviation Calculator project:

Mean-Variance-Standard Deviation Calculator

A Python project that uses NumPy to calculate statistical measures from a list of nine numbers arranged into a 3×3 matrix.

Features

  • Calculates:

    • Mean
    • Variance
    • Standard Deviation
    • Maximum Value
    • Minimum Value
    • Sum
  • Returns results for:

    • Each column
    • Each row
    • The entire matrix

Technologies Used

  • Python
  • NumPy

Project Structure

mean-variance-standard-deviation-calculator/
│
├── mean_var_std.py
├── test_module.py
└── README.md

How It Works

The program accepts a list containing exactly nine numbers.

Example Input:

calculate([1, 2, 3, 4, 5, 6, 7, 8, 9])

The list is converted into the following matrix:

[[1 2 3]
 [4 5 6]
 [7 8 9]]

The program then calculates statistical values across rows, columns, and the entire matrix.

Example Output

{
  'mean': [[4.0, 5.0, 6.0], [2.0, 5.0, 8.0], 5.0],
  'variance': [[6.0, 6.0, 6.0],
               [0.6666666666666666, 0.6666666666666666, 0.6666666666666666],
               6.666666666666667],
  'standard_deviation': [[2.449489742783178, 2.449489742783178, 2.449489742783178],
                         [0.816496580927726, 0.816496580927726, 0.816496580927726],
                         2.581988897471611],
  'max': [[7, 8, 9], [3, 6, 9], 9],
  'min': [[1, 2, 3], [1, 4, 7], 1],
  'sum': [[12, 15, 18], [6, 15, 24], 45]
}

Validation

The function requires exactly nine numbers.

Example:

calculate([1, 2, 3])

Output:

ValueError: List must contain nine numbers.

Learning Outcomes

Through this project, I practiced:

  • NumPy arrays and matrix operations
  • Statistical calculations using NumPy
  • Data reshaping with reshape()
  • Error handling in Python
  • Writing clean and reusable functions

Author

Bhavana Ramaswaram

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages