Skip to main content
SciNet
  • Home
  • All Courses
  • Calendar
  • Certificates
  • SciNet
    Main Site Documentation my.SciNet
  • CCDB
  • More
Close
Toggle search input
English
English Français
You are currently using guest access
Log in
SciNet
Home All Courses Calendar Certificates SciNet Collapse Expand
Main Site Documentation my.SciNet
CCDB
Expand all Collapse all
  1. Dashboard
  2. BCH2203 - Winter 2024
  3. Assignment 2: Numpy

Assignment 2: Numpy

Completion requirements
Opened: Wednesday, 31 January 2024, 12:00 AM
Due: Wednesday, 7 February 2024, 11:59 PM

Below is a reference solution for assignment 1

FOr the assignment, 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 script should then call these functions to achieve the same result as before.

Use numpy functions where you can.    

Try this out on the data file from assignment 1.    

Use best practices.


  • survey-analysis.py survey-analysis.py
    2 February 2024, 2:58 PM
Contact site support
You are currently using guest access (Log in)
Data retention summary


All content on this website is made available under the Creative Commons Attribution 4.0 International licence, with the exception of all videos which are released under the Creative Commons Attribution-NoDerivatives 4.0 International licence.
Powered by Moodle