Path: blob/master/Python for Data Science/Numpy Questions.ipynb
3074 views
Kernel: Python 3 (ipykernel)
Write a NumPy program to test whether none of the elements of a given array is zero.
Write a NumPy program to create an array of 5 zeros, 5 ones, 5 fives.
Write a NumPy program to generate an array of 15 random numbers from a standard normal distribution
In [8]:
Out[8]:
array([[0.5488135 , 0.71518937],
[0.60276338, 0.54488318]])
For following Array
A=[[1,2,3],[5,6,7],[13,14,-8]
B =[[[1,1,1],[2,3,4]],[[2,5,7],[3,8,7]]] Find:
Mean of second row(A) and mean of first row from first axis(B)
Reshape array B and save it to a variable C
Do matrix multiplication of array C and a unity matrix(create shape according to the mul properties)
create a subset for row 3 of matrix A and save it in variable d.
Write a NumPy program to create a vector with values ranging from 10 to 40 and print all values except the first and last.
Write a NumPy program to create a vector with values from 1 to 15 and change the sign of the numbers in the range from 10 to 15.
Write a NumPy program to create a 3x4 matrix filled with values from 10 to 21
Write a NumPy program to compute the inner product of two given vectors
Write a NumPy program to create a structured array from given student name, height, class and their data types. Now sort the array on height.
In [ ]:
Write a NumPy program to add, subtract, multiply, divide arguments element-wise.
Write a NumPy program to get the minimum and maximum value of a given array along the second axis.
Write a NumPy program to display all the dates for the month of May, 2021
In [1]:
Out[1]:
May, 2021
['2021-05-01' '2021-05-02' '2021-05-03' '2021-05-04' '2021-05-05'
'2021-05-06' '2021-05-07' '2021-05-08' '2021-05-09' '2021-05-10'
'2021-05-11' '2021-05-12' '2021-05-13' '2021-05-14' '2021-05-15'
'2021-05-16' '2021-05-17' '2021-05-18' '2021-05-19' '2021-05-20'
'2021-05-21' '2021-05-22' '2021-05-23' '2021-05-24' '2021-05-25'
'2021-05-26' '2021-05-27' '2021-05-28' '2021-05-29' '2021-05-30'
'2021-05-31']
Write a NumPy program to capitalize the first letter, lowercase, uppercase, swapcase, title-case of all the elements of a given array
In [ ]: