# Python Numpy Data Analysis Exercises

1. Write a Python Numpy program to generate 3x3 matrix and display the maximum and minimum of y axis .

The output is:

3x3 matrix:
[[0 1 2]
[3 4 5]
[6 7 8]]

Maximum value along the y axis: [2 5 8]
Minimum value along the y axis: [0 3 6]

Click for the answer

2. Write a Python Numpy program to generate 3x3 array and display the maximum and minimum of value in the 3x3 array.

The output is:

3x3 array:
[[0 1 2]
[3 4 5]
[6 7 8]]

Maximum value of the array:
8
Minimum value of the array:
0

Click for the answer

3. Write a Python Numpy program to generate 3x3 array and calculate to find out the difference between maximum and minimum value in x axis.

The output is:

3x3 array:
[[0 1 2]
[3 4 5]
[6 7 8]]

Difference between the maximum and the minimum values of the 3x3 array:
[2 2 2]

Click for the answer

4. Write a Python Numpy program to generate 4x3 array and find out the median of the array.

The output is:

Initial 3x4 array:
[[ 0 1 2 3]
[ 4 5 6 7]
[ 8 9 10 11]]

Median of 3x4 array: 5.5

Click for the answer

5. Write a Python Numpy program to calculate the 65th percentile for all elements in the 3x4 array along the first axis (x-axis).

The output is:

Initial 3x4 array:
[[ 0 1 2 3]
[ 4 5 6 7]
[ 8 9 10 11]]

65th percentile for all elements of the 3x4 array along the first axis:
[5.2 6.2 7.2 8.2]

Click for the answer

6. Write a Python Numpy program to calculate weight average of the given array in the following output.

The output is:

Initial array: [1 2 3 4 5]
Weights:    [2 3 4 5 6]

Weighted average of the array: 3.5

Click for the answer

7. Write a Python Numpy program to calculate the mean, standard deviation and variance of the given array in the following output.

The output is:

Initial array: [1 2 3 4 5]
Mean: 3.0
Standard deviation: 1.707825127659933
Variance: 2.9166666666666665

Click for the answer

8. Write a Python Numpy program to calculate cross-correlation of the two given array in the following output.

The output is: