Notice: Due to an ongoing migration of our storage and publishing system, material requested since last month will not be uploaded for the time being, and new requests are paused. All existing notes remain available.

Unit 4 subjective questions Array Operations using NumPy

ECE181 — Introduction To Python 20 questions with model answers. Write yours first, then compare.

Read the notes Practice MCQs
  1. Question 1 of 20

    Distinguish between NumPy arrays and Python lists. Explain at least four key differences with examples.

  2. Question 2 of 20

    Define a NumPy array. Explain the different ways to create arrays in NumPy with examples.

  3. Question 3 of 20

    Explain the concept of data types (dtype) in NumPy. Why is specifying a data type important?

  4. Question 4 of 20

    Describe the various arithmetic operations that can be performed on NumPy arrays with examples.

  5. Question 5 of 20

    What is broadcasting in NumPy? Explain the broadcasting rules with examples.

  6. Question 6 of 20

    Explain the commonly used statistical functions in NumPy with examples.

  7. Question 7 of 20

    Explain array indexing and slicing in NumPy with suitable examples.

  8. Question 8 of 20

    Compare vectorized operations with traditional loop-based operations in Python. Why are vectorized operations faster?

  9. Question 9 of 20

    Describe the important attributes of a NumPy array such as shape, ndim, size, and dtype with examples.

  10. Question 10 of 20

    Explain reshaping of arrays in NumPy. Discuss the reshape(), flatten(), and ravel() methods.

  11. Question 11 of 20

    What are aggregate functions in NumPy? Explain how the axis parameter affects their behavior in multidimensional arrays.

  12. Question 12 of 20

    Explain the difference between a copy and a view of a NumPy array. Why is this distinction important?

  13. Question 13 of 20

    Describe how to perform matrix operations like matrix multiplication, transpose, and dot product using NumPy.

  14. Question 14 of 20

    Explain boolean masking and fancy indexing in NumPy with examples.

  15. Question 15 of 20

    Derive and demonstrate how broadcasting works when adding a 1D array to a 2D array of different shapes. Include shape analysis.

  16. Question 16 of 20

    Explain in detail the advantages of using NumPy over standard Python data structures for scientific computing. Support your answer with performance and functionality aspects.

  17. Question 17 of 20

    Explain the functions used to join and split arrays in NumPy, such as concatenate(), vstack(), hstack(), and split().

  18. Question 18 of 20

    Explain universal functions (ufuncs) in NumPy. Give examples of mathematical and trigonometric ufuncs.

  19. Question 19 of 20

    Given an array of exam scores, explain how you would compute descriptive statistics (mean, median, standard deviation, min, max) and interpret the results. Provide code and formulas.

  20. Question 20 of 20

    Explain type casting and type promotion in NumPy operations. What happens when arrays of different data types are combined?

That's unit 4

Long answers stick best when they're tested again soon. Run the MCQs on this unit, then come back to the questions you found hardest.