Skip to content

CSE-SJCET/numpy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NumPy Assignment – Detailed Questions

Instructions

  • Complete all the following tasks using NumPy and Matplotlib.
  • Write clean and readable code.
  • Each function should return the required output.
  • Do not hardcode answers.

Part A: Basics and Array Creation

  1. Create a NumPy array containing numbers from 1 to 10.
  2. Create a 3x3 matrix filled with zeros.
  3. Create a 3x3 identity matrix.
  4. Create an array with values from 10 to 50 with a step of 5.

Part B: Arithmetic Operations

  1. Given two arrays: a = [1, 2, 3]
    b = [4, 5, 6]

    Perform:

    • Element-wise addition
    • Element-wise subtraction
    • Element-wise multiplication
    • Element-wise division

Part C: Slicing and Indexing

  1. Create an array from 0 to 19.
  2. Extract:
    • First 5 elements
    • Last 5 elements
    • Elements from index 5 to 10
  3. Reverse the array.

Part D: Matrix Operations

  1. Create two 2x2 matrices and perform:
    • Matrix multiplication
    • Transpose of a matrix
    • Determinant of a matrix

Part E: Random Numbers

  1. Generate:
  • 5 random numbers between 0 and 1
  • A 3x3 matrix with random integers between 1 and 10
  1. Find the maximum and minimum values from the generated array.

Part F: Plotting and Visualization

  1. Plot the graph of:
  • y = x^2
  • y = x^3

For x values from 0 to 10.

  1. Add:
  • Title
  • X and Y labels
  • Legend

Submission Guidelines

  • Submit your completed assignment.py file.
  • Ensure all functions are implemented correctly.
  • Code will be evaluated using automated tests.

Evaluation Criteria

  • Correctness: 60%
  • Code Quality: 20%
  • Visualization: 20%

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages