NUMPY-lab Assignment-5
NUMPY-lab Assignment-5
LAB-ASSIGNMENT-5
M.Sc. (DATA ANALYST) Dissertation
Submitted to christ university
Masters of Science
By
A.LAHARI
Registration Number: 2139465
submitted to
SIVAKUMAR.R
CHRIST UNIVERSITY
Banglore, Karnataka-560029
(DEEMED TO BE UNIVERSITY)
August, 2021
LAB ASSIGNMENT-5
NUMPY
1. Demonstrate the following Numpy operations:
i. Array Creation
array(), arange(), zeroes, ones, full(), eye(), random(), linspace()
CODING:
1. Creating an array()
Output:
2.Using array()
Output:
3.Using zeroes()
Output:
4.Using ones()
Output:
5.Using full()
Output:
6.Using eye()
Output:
7.Using random()
Output:
8.Using linspace()
Output:
Output:
2. Creating an array to determine the shape of the array
Coding:
Output:
Coding:
Output:
Output:
❖ Indexing of arrays:
Getting and setting the value of individual array elements
Output:
❖ .Slicing of arrays:
Getting and setting smaller sub arrays within a larger array
Coding:
Output:
❖ Reshaping of arrays:
Changing the shape of a given array – reshape()
Coding:
Output:
Error case:
Output:
As we cannot arrange the matrix into (3,3) it will show us an error