DATA 419 — Data Mining (Machine Learning I) — Fall 2026
Possible experience: +20XP
Due: Thursday, Sept. 17th, midnight
NumPy is an ubiquitous Python library for working efficiently with numerical data, especially arrays and matrices. Its central data structure, the ndarray, lets you store many numbers together and perform operations on all of them at once, without writing explicit loops. NumPy provides tools for tasks such as indexing and slicing, reshaping arrays, matrix multiplication, computing sums and averages, generating random numbers, and applying mathematical functions. It is also a foundation for much of the scientific Python ecosystem, including libraries such as pandas, SciPy, scikit-learn, and many machine-learning tools.
Get a coke, go to the "NumPy for absolute beginners" tutorial, and learn what you're doing.
Get a copy of the numpypractice.py file on your machine by
following the git
and GitHub setup instructions. When you have finished those instructions,
you should have your own local copy of the class repository, including
numpypractice.py.
Now create a new file, in the same folder, called myumwnetid_numpypractice.py, where myumwnetid should be replaced by your real-life UMW NetID. (For example, jsmith19_numpypractice.py would be a legit name.) Please do not get creative in naming this file. Do not capitalize your Net ID, or invent a new Net ID, or omit the underscore, or change the underscore to a dash or a space, or do anything else creative, period. Just call it myumwnetid_numpypractice.py, where myumwnetid is replaced by your actual UMW NetID. Thanks.
Then, from the command line, make sure you're in the right folder/directory using the "cd" command to get there. Then, type this in your command line:
python myumwnetid_numpypractice.py
with "myumwnetid" once again changed to your actual UMW Net ID. Verify you can see a message with this line at the end:
... You got +0XP! (out of a possible 20XP)
You are now ready to actually start writing NumPy code.
Open your myumwnetid_numpypractice.py file in your editor, and begin reading the comments. Every time you encounter the words "YOUR CODE GOES HERE", that's your cue to add code that solves the problem immediately above. You can work on these items in any order.
Any time you want to check your work, rerun "python myumwnetid_numpypractice.py" on the command line. Your new score will show in the display.
To turn in this assignment, send me an email with subject line "DATA 419 NumPy practice turnin", and with your myumwnetid_numpypractice.py file as an attachment, by the deadline.
I'm happy to answer questions and give hints! Come to office hours, or send me email with subject line "DATA 419 NumPy practice help!!"