Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
suyashi29
GitHub Repository: suyashi29/python-su
Path: blob/master/Data Science using Python/Numpy Lab Day 2.ipynb
3074 views
Kernel: Python 3 (ipykernel)
  • Create a NumPy array with elements ranging from 0 to 9. Then, reshape it into a 3x3 matrix.

  • Create a 2D array of Shape 2*4 with defined elements in row1 - M1

  • Create a 2D identify matrix of shape 3*3- M2

  • Create a 2D ones matrix with Shape 2*4-M3

Compute: 1. M1+M3 2. M3M1 3. 4M2

  • Given two NumPy arrays A and B, perform element-wise addition, subtraction, multiplication, and division.

  • Extract the middle row of a given 2D NumPy array. Then, extract the elements at odd indices from the last column.

  • Compute the mean, median, and standard deviation of a given NumPy array across rows and columns.

  • Concatenate two 1D NumPy arrays vertically and horizontally, respectively.

  • Given a 1D NumPy array of ages, find all ages greater than 30.

  • Given a 2D NumPy array representing student scores and a 1D array representing score weights, compute weighted averages for each student.

  • Generate a random 3x3 NumPy array of integers between 0 and 100.