Assignment

# 2. Survey Analysis Improved

Completion requirements

**Opened:**Wednesday, 2 February 2022, 1:30 PM

**Due:**Wednesday, 9 February 2022, 11:59 PM

Start from the reference solution (below) for assignment 1.

Split this into three functions:

- One function should read the data and store it in a 2-dimensional numpy array containing 0's and 1's (such that N becomes 0 and Y becomes 1).
- A second function should take such a numpy array as an argument and compute, for each of the questions, the percentage of 'N' and 'Y' answers.
- A third function should take such a numpy array and print the number of surveys with zero 'Y' answers, then the number of surveys with one 'Y' answer, with two 'Y' answers, etc.

The new script should include these functions and then call these functions to achieve the same result as in assignment 1.

Use numpy functions where you can.

Try this out on the data file from assignment 1.

Use best practices.

The late policy is stated in the syllabus.

- 2 February 2022, 1:36 PM