0% found this document useful (0 votes)
7 views

Python Array Questions

python_array_questions

Uploaded by

Punit Gupta
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views

Python Array Questions

python_array_questions

Uploaded by

Punit Gupta
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1

10 Mark Questions in Python

1. Explain how to create arrays from numerical ranges using NumPy. Provide examples for
creating arrays with evenly spaced values and random values.

2. What is advanced indexing in NumPy? Describe the difference between basic slicing and
advanced indexing with relevant code examples.

3. Discuss broadcasting in NumPy. How does broadcasting work with arrays of different
shapes? Provide examples to illustrate your explanation.

4. How can you iterate over a NumPy array efficiently? Explain different methods of
iterating and their use cases.

5. Describe the various techniques for array manipulation in NumPy, including reshaping,
transposing, and joining arrays. Include examples for each technique.

6. What are binary operators in NumPy? Write a program demonstrating how binary
operations like AND, OR, and XOR can be performed on NumPy arrays.

7. Explain the use of string functions in NumPy. Provide examples showing how to perform
basic string operations like splitting, joining, and manipulating strings within an array.

8. Discuss the mathematical functions available in NumPy. Write a program using functions
like sin, cos, log, and exp on an array of values.

9. How are arithmetic operations performed in NumPy? Give examples of addition,


subtraction, multiplication, and division of NumPy arrays with broadcasting.

10. Explain how to handle special cases like NaN (Not a Number) and infinity in NumPy.
Write code that demonstrates how to detect and handle these values in an array.

You might also like