Thadomal Shahani Engineering College: Department of Information Technology
Thadomal Shahani Engineering College: Department of Information Technology
Theory:
User Input Handling: The program takes user input to create arrays dynamically, including a 2D
array and a list of student marks.
1. NumPy Array Creation: Lists are converted into NumPy arrays for efficient numerical
operations.
2. Array Properties: The program retrieves and displays properties like data type, shape,
size, number of dimensions, and item size.
3. Slicing: A portion of the 2D array is extracted using slicing techniques.
4. Reshaping: The 2D array is reshaped into a 3D array using NumPy’s reshape() function.
5. Arithmetic Operations: Element-wise addition, subtraction, multiplication, division, and
exponentiation are performed on two NumPy arrays.
6. Mathematical Functions: Functions like sum(), mean(), max(), min(), and std() are used
for numerical analysis.
7. Statistical Analysis: The program computes statistical metrics (mean, median, min, max)
on student marks.
8. Efficiency of NumPy: NumPy’s optimized operations enable faster computations
compared to Python lists.
9. Modular Implementation: The code is structured into separate sections for handling
arrays, arithmetic operations, and statistical computations.
Program with output:
Conclusion:
This program demonstrates the power and efficiency of NumPy for numerical computing. It
covers array creation, manipulation, arithmetic operations, slicing, reshaping, and statistical
analysis. By utilizing NumPy, the program performs operations much faster than traditional
Python lists, making it ideal for handling large datasets. The structured approach ensures
modularity, allowing easy modifications and scalability. This showcases NumPy’s versatility in
scientific computing and data analysis.