You are on page 1of 1

1.What are numpy arrays?

Sol:A NumPy array is a table of elements(usually numbers), all of the same type, indexed by a tuple of
integers.

NumPy arrays are also called ndarrays. The ndarrays can be 1-dimensional,2-dimensional or
multidimensional.

2.What is the relationship between the rank of an array and the shape of the array?

The number of dimensions(axes) in an ndarray is known as its rank.

A shape is tuple that stores the number of elements in each dimension of the ndarray.

Thus the length(len() )of shape tuple is same as that of rank of the ndarray

3.write a NumPy program to print the NumPy version in your program

Import numpy as np

Print(np.__version__)

4.write a statement that imports numpy package to present program environment

Import numpy as np

You might also like