Notice: Function register_block_script_handle was called incorrectly. The asset file (/home/u749286766/domains/usetq.com/public_html/wp-content/plugins/seo-by-rank-math/includes/modules/schema/blocks/faq/assets/js/index.asset.php) for the "editorScript" defined in "rank-math/faq-block" block definition is missing. Please see Debugging in WordPress for more information. (This message was added in version 5.5.0.) in /home/u749286766/domains/usetq.com/public_html/wp-includes/functions.php on line 6031

Notice: Function register_block_script_handle was called incorrectly. The asset file (/home/u749286766/domains/usetq.com/public_html/wp-content/plugins/seo-by-rank-math/includes/modules/schema/blocks/howto/assets/js/index.asset.php) for the "editorScript" defined in "rank-math/howto-block" block definition is missing. Please see Debugging in WordPress for more information. (This message was added in version 5.5.0.) in /home/u749286766/domains/usetq.com/public_html/wp-includes/functions.php on line 6031

Notice: Function register_block_script_handle was called incorrectly. The asset file (/home/u749286766/domains/usetq.com/public_html/wp-content/plugins/seo-by-rank-math/includes/modules/schema/blocks/schema/assets/js/index.asset.php) for the "editorScript" defined in "rank-math/rich-snippet" block definition is missing. Please see Debugging in WordPress for more information. (This message was added in version 5.5.0.) in /home/u749286766/domains/usetq.com/public_html/wp-includes/functions.php on line 6031
Indexing on ndarrays - use Technical Quotient

1.   Remember


What is the output of x[np.array([3, 3, -3, 8])] given x = np.arange(10, 1, -1)?






2.   Understand


Why does x[np.array([3, 3, -3, 8])] return array([7, 7, 4, 2]) for x = np.arange(10, 1, -1)?






3.   Understand


What is the effect of indexing with multidimensional index arrays on the shape of the resultant array?






4.   Apply


Given y = np.arange(35).reshape(5, 7), how would you select the elements 0, 15, and 30 using integer array indexing?






5.   Apply


How can you use broadcasting with integer array indexing to select the corner elements 0, 2, 9, and 11 from x = np.array([[0, 1, 2], [3, 4, 5], [6, 7, 8], [9, 10, 11]])?






6.   Analyze


Why does using x[[0, 1, 2], [0, 1, 0]] return array([1, 4, 5]) from x = np.array([[1, 2], [3, 4], [5, 6]])?






7.   Analyze


Given x[np.ix_(rows, columns)] results in a selection of corner elements from x, what does this imply about rows and columns when x is a 4x3 matrix?






8.   Remember


What does the expression x[~np.isnan(x)] return when x is a NumPy array?






9.   Understand


What is the result of x[x < 0] += 20 when x is a NumPy array containing negative values?






10.   Understand


How does NumPy treat boolean indexing when obj.ndim is less than x.ndim?






11.   Apply


How would you filter x = np.array([[1, 2], [3, 4], [5, 6]]) to select rows where the first element is greater than 2?






12.   Apply


Given the following code snippet:
import numpy as np\nx = np.arange(10).reshape(2, 5)
How can you select elements greater than 4 using a boolean array?






13.   Analyze


What happens if you use a boolean index array b with b.ndim < x.ndim to index array x, and how does it affect the resulting array shape?






14.   Analyze


Given a boolean array b of shape (2, 3) used to index a 3D array x of shape (2, 3, 5), resulting in a 2D array, what explains this behavior?






15.   Remember


What is the result of y[np.array([0, 2, 4]), 1:3] when y = np.arange(35).reshape(5,7)?






16.   Understand


Why is using a slice (1:2) preferable to a single advanced index ([1]) when possible?






17.   Apply


Given x = np.arange(60).reshape(3,4,5) and a boolean array mask = (x % 10 == 0), how would you select the elements divisible by 10 from the second row of each 2D subarray?






18.   Apply


You have x = np.arange(100).reshape(10,10) and want to select the first, fifth, and ninth rows, but only columns three to seven. How do you accomplish this?






19.   Analyze


Given an array x = np.random.rand(10,10,10) and indices ind1 = np.array([1, 3, 7]) and ind2 = np.array([0, 4, 6]) shaped (3,), why does x[:, ind1, ind2].shape result in (10, 3, 3) instead of (3, 10, 3)?






Leave a Reply

Your email address will not be published. Required fields are marked *