15,747,845 members
1.00/5 (1 vote)
See more:
```Anonymised scores (out of 60) for an examination are stored in a NumPy array. Write:

A function that takes a NumPy array of the raw scores and returns the scores as percentages, sorted from lowest to highest (try using scores.sort(), where scores is a NumPy array holding the scores).

A function that returns the maximum, minimum and mean of the raw scores as a dictionary with the keys 'min', 'max' and 'mean'. Use the NumPy array functions min(), max() and mean() to do the computation, e.g. max = scores.max().

Design your function for the min, max and mean to optionally exclude the highest and lowest scores from the computation of the min, max and mean.

Hint: sort the array of scores and use array slicing to exclude the first and the last entries.

Use the scores

scores = np.array([58.0, 35.0, 24.0, 42, 7.8])
to test your functions.```

What I have tried:

```def to_percentage_and_sort(scores):
# YOUR CODE HERE
raise NotImplementedError()

def statistics(scores, exclude=False):
# YOUR CODE HERE
raise NotImplementedError()```
Posted
Updated 5-Nov-20 2:12am

Solution 1

`# YOUR CODE HERE`

That is the part that you are expected to write. This site does not provide code to order. However, if you have a specific question then please ask it and people will try to help you.

v3
wendy monyee 5-Nov-20 12:40pm
I dont know what to do :-( Please help me
Richard MacCutchan 5-Nov-20 12:51pm
Start by learning Python, or studying your course notes. If you cannot understand either of those then talk to your teacher.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Top Experts
Last 24hrsThis month
 Graeme_Grant 30 JudyL_MD 30 honey the codewitch 10 raddevus 10 Mordac the Preventer -8
 OriginalGriff 135 Graeme_Grant 120 Richard MacCutchan 60 JudyL_MD 10 honey the codewitch 10

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900