9818 Exp8 Python

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 10

Exp No:__8__

Title: Write Python scripts for NumPy operations

Lab Code/Theory :
1. Create a 1D NumPy array from the list

SE_ECS_Python Lab(23-24) Roll No:9818


2. Create a 2D NumPy array from the list

3. Create 4 x 4 NumPy array from 1 to 16

SE_ECS_Python Lab(23-24) Roll No:9818


4. Use a tuple [1,2,3,4] to create NumPy array

5. Get the sum of second and third elements of the above array

SE_ECS_Python Lab(23-24) Roll No:9818


6. Create a 7 by 7 NumPy array from 1 to 49. Extract the middle element

7. Create a 4 by 4 NumPy array from 1 to 16 .Extract the last row

SE_ECS_Python Lab(23-24) Roll No:9818


8. Write two 2 D NumPy arrays and perform matrix multiplication

SE_ECS_Python Lab(23-24) Roll No:9818


SE_ECS_Python Lab(23-24) Roll No:9818
A]

B]

SE_ECS_Python Lab(23-24) Roll No:9818


C]

SE_ECS_Python Lab(23-24) Roll No:9818


Post lab :
1. There is an array : [[0,0,0],[1,2,3],[4,5,6]]). Add the elements of the first
column by 10,
SE_ECS_Python Lab(23-24) Roll No:9818
second column by 20 and third column by 30. Use NumPy broadcasting

SE_ECS_Python Lab(23-24) Roll No:9818

You might also like