0% found this document useful (0 votes)
2 views1 page

Numpy Advanced Functional Analysis Questions

The document outlines a series of advanced NumPy tasks focused on analyzing a dataset of student scores across multiple subjects. Key operations include calculating averages, ranges, and variances, as well as normalizing scores and identifying trends in performance. It also involves using various NumPy functions for data transformation and statistical analysis.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views1 page

Numpy Advanced Functional Analysis Questions

The document outlines a series of advanced NumPy tasks focused on analyzing a dataset of student scores across multiple subjects. Key operations include calculating averages, ranges, and variances, as well as normalizing scores and identifying trends in performance. It also involves using various NumPy functions for data transformation and statistical analysis.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

NumPy Advanced Functional Analysis and Transformation

import numpy as np

# Dataset: Scores of 5 students in 4 subjects (rows: students, cols: subjects)


scores = np.array([
[85, 78, 92, 88],
[70, 65, 80, 75],
[90, 88, 95, 93],
[60, 72, 68, 65],
[88, 85, 90, 86]
])

NumPy Advanced Knowledge Test - Functional and Statistical Analysis

Dataset:
Scores of 5 students in 4 subjects

1. Use np.apply_along_axis to calculate the average score per student.


2. Use np.apply_along_axis to calculate the range (max - min) of each subject.
3. Identify the student with the highest total score using np.argmax.
4. Normalize the scores per subject using broadcasting.
5. Find which student showed the most improvement between subject 1 and 4.
6. Replace all scores below the subject-wise average with the string 'low'.
7. Count how many students scored above 85 in all subjects using boolean masking.
8. Use np.where to convert scores > 90 to 'excellent', 75-90 to 'good', and below 75 to
'average'.
9. Sort the entire array row-wise (student-wise) using np.sort.
10. Find the correlation coefficient between subject 1 and subject 4.
11. Calculate variance and standard deviation for each subject.
12. Create a mask to highlight students who scored above average in more than 2
subjects.
13. Apply a function using np.vectorize to curve each score: add 5 if < 85, else add 2.
14. Calculate the z-score of each score per subject using broadcasting.
15. Replace the lowest score in each student's row with zero.
16. Use np.clip to bound all scores between 70 and 90.
17. Identify all students who scored the same in at least two subjects.
18. Count how many times each score appears using np.unique with return_counts.
19. Compute the average of the top 2 scores in each row.
20. Add a new subject column with random scores between 60-100.

You might also like