Posts

Showing posts from December, 2021

University Question Papers and Answer Keys Programming in Python CST 362 KTU

BTech Examinations S6 May 2026 QP    

numpy assignment

  1.Create a NumPy array of integers from 10 to 50. Print: shape data type size 2.Create a 5×5 matrix filled with zeros, then set the border elements to your roll number . 3.Create a 4×4 identity matrix and multiply it by 5. 4.Create two random arrays of size (3,3) and: ( use np.random.randint() function) add them subtract them multiply element-wise 5.Create a 1D array of numbers from 1–20. Reshape it into: (4,5) (5,4) 6.Create a 6×6 matrix with numbers from 1 to 36. Extract: first 2 rows last 2 columns center 2×2 block 7.From the above matrix, extract all even numbers. 8.Replace all values greater than 20 with 0. ( use np.where) 9.Reverse a 1D array using slicing (no loops). 10.Create a matrix and swap its first and last rows. 11.Generate 50 random numbers. Find: mean median standard deviation minimum & maximum 12.Create a 5×4 random matrix. Find: row-wise mean column-wise mean 13.Normalize a 1D array using: ( x − m e a n ) / s t d (x - mean) / std 14. Find the index of: l...