python + numpy test

1. python + numpy test_第1张图片

python + numpy test_第2张图片

2. What is the correct syntax to output the type of a variable or object in Python?

Syntax of the Python type() functionThe type() function

3. upper() 全大写

lower() 全小写

4. python + numpy test_第3张图片

接下来是Numpy部分

1. What is a correct syntax to check the number of dimensions in an array?

arr.ndim  

python + numpy test_第4张图片

2. What is a correct syntax to check the data type of an array?

python + numpy test_第5张图片

3. copies and views

Copies and views

When operating on NumPy arrays, it is possible to access the internal data buffer directly using a view without copying data around. This ensures good performance but can also cause unwanted problems if the user is not aware of how this works. Hence, it is important to know the difference between these two terms and to know which operations return copies and which return views.

The NumPy array is a data structure consisting of two parts: the contiguous data buffer with the actual data elements and the metadata that contains information about the data buffer. The metadata includes data type, strides, and other important information that helps manipulate the ndarray easily. See the Internal organization of NumPy arrays section for a detailed look.

读这篇:Copies and views — NumPy v1.26 Manual

4. What is a correct syntax to return the shape of an array?

python + numpy test_第6张图片

5. What is a correct method to search for a certain value in an array?

python + numpy test_第7张图片

6. When using the NumPy random module, how can you return a random number from 0 to 100?

python + numpy test_第8张图片

7. python + numpy test_第9张图片

python + numpy test_第10张图片

你可能感兴趣的:(python,css,html)