in Technology by
What are the steps to use shape for a 1D array, 2D array and 3D/ND array respectively in NumPy?

1 Answer

0 votes
by

1D Array:

num=[1,2,3] if not added

print(‘\nshpae of 1d ‘,num.shape)

2D Array:

num2=[[1,2,3],[4,5,6]] if not added

print(‘\nshpae of 2d ‘,num2.shape)

3D or ND Array: 

num3=[[[1,2,3],[4,5,6],[7,8,9]]] if not added

print(‘\nshpae of 3d ‘,num3.shape)

Related questions

0 votes
    List the steps to create a 1D array and 2D array in NumPy?...
asked Apr 24, 2021 by JackTerrance
0 votes
    What is the difference between 1D, 2D and 3D convolutions in CNN? Please explain with examples. Select the correct answer from above options...
asked Jan 24, 2022 in Education by JackTerrance
0 votes
    How to dynamically allocate a 1D and 2D array in c?...
asked Jan 24, 2021 in Technology by JackTerrance
0 votes
    Which of the following function stacks 1D arrays as columns into a 2D array? (a) row_stack (b) ... questions and answers pdf, Data Science interview questions for beginners...
asked Oct 28, 2021 in Education by JackTerrance
0 votes
    How do you create a 3D array in NumPy?...
asked Apr 24, 2021 in Technology by JackTerrance
0 votes
    I have the 4D array, which is defined as follows: B = np.array( [[[[0.5000, 0.5625], [0.5000, ... loops and ideally one function call. Select the correct answer from above options...
asked Jan 19, 2022 in Education by JackTerrance
0 votes
    _________ display contours of a 3d surface in 2d. (a) aes_contour (b) geom_contour (c) aes_gem (d) ... Analysis of R Programming Select the correct answer from above options...
asked Feb 13, 2022 in Education by JackTerrance
0 votes
    I have three 3D mesh matrices (X, Y, Z) corresponding to the xyz coordinate space. I also have a ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 19, 2022 in Education by JackTerrance
0 votes
    How Do I Make 3d Plots/visualizations Using Numpy/scipy?...
asked Apr 25, 2021 in Technology by JackTerrance
0 votes
    Consider a circuit having 3 identical Ammeters A1, A2, A3 parallel to one another. The 1^st Ammeter is in ... for GATE EC Exam, Network Theory MCQ (Multiple Choice Questions)...
asked Oct 12, 2021 in Education by JackTerrance
0 votes
    I am trying to fit some (numpy) data into python skLearn modules, but keep getting error messages. When ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jun 3, 2022 in Education by JackTerrance
0 votes
    How is the dynamic memory allocation in 1D array in C?...
asked Jan 24, 2021 in Technology by JackTerrance
0 votes
    Which of the following returns an array of ones with the same shape and type as a given array? (a) all_like (b) ones_like (c) one_alike (d) all of the mentioned...
asked Oct 9, 2021 in Technology by JackTerrance
0 votes
    The ________ function returns its argument with a modified shape, whereas the ________ method modifies the array itself. (a) ... (c) reshape2, resize (d) all of the mentioned...
asked Oct 7, 2021 in Technology by JackTerrance
0 votes
    Which of the following returns an array of ones with the same shape and type as a given array? (a) ... questions and answers pdf, Data Science interview questions for beginners...
asked Oct 28, 2021 in Education by JackTerrance
...