0% found this document useful (0 votes)
5 views1 page

Numpy Assignment

NumPy is a Python library designed for numerical and scientific computing, offering support for large multi-dimensional arrays and efficient mathematical operations. It is faster than regular Python lists, supports vectorized operations, and integrates well with data science and machine-learning libraries. The document also provides examples of creating 2D and 3D arrays using NumPy.

Uploaded by

Mini
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views1 page

Numpy Assignment

NumPy is a Python library designed for numerical and scientific computing, offering support for large multi-dimensional arrays and efficient mathematical operations. It is faster than regular Python lists, supports vectorized operations, and integrates well with data science and machine-learning libraries. The document also provides examples of creating 2D and 3D arrays using NumPy.

Uploaded by

Mini
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Assignment: NumPy Basics 1. What is NumPy?

NumPy (Numerical Python) is a Python library used


for numerical and scientific computing. It provides support for large multi-dimensional arrays and
matrices and includes a large collection of mathematical functions to operate on these arrays efficiently.
Why should we use NumPy? • It is faster than regular Python lists due to optimized C-based
operations. • It supports multi-dimensional arrays for scientific and machine-learning tasks. • It provides
vectorized operations which reduce the need for loops. • It integrates well with data science and
machine-learning libraries. 2. Steps to create a 2D array Example: from numpy import array arr2d =
array([[1, 2, 3], [4, 5, 6]]) Output: [[1 2 3] [4 5 6]] 3. Steps to create a 3D array Example: from numpy
import array arr3d = array([ [[1, 2], [3, 4]], [[5, 6], [7, 8]] ]) Output: [ [[1 2] [3 4]] [[5 6] [7 8]] ]

You might also like