CSC 223 -
Python for Scientific Programming & Data Manipulation,
Fall 2024, MW 3-4:15 and 4:30-5:45 PM, Old Main 159.
Take-home Final Exam / Assignment 5 Specification, CPSC223FinalExam2024.txt
with answers is
due by end of Wednesday December 11
via D2L.
We will go
over this in the December 4 class. I
will not take questions on the exam. See CPSC223FinalExam2024.txt
for links to references and the study guide.
Illustrations are below.
ADDED December 4
after class, how to run python or ipython from
the command line on arya to try things out:
1. Log into acad and from there to arya
as usual.
2. Type either of these into the Linux command
line to start the tool. I have included short
example expressions:
/usr/bin/python3.11
Python 3.11.7 (main, Jul 4 2024,
00:00:00) [GCC 11.4.1 20231218 (Red Hat 11.4.1
-3)] on linux
Type "help", "copyright", "credits" or
"license" for more information.
>>> 1+2
3
>>> 1-3
-2
>>> quit()
OR
/usr/local/bin/ipython3
Python 3.11.7 (main, Jul 4 2024,
00:00:00) [GCC 11.4.1 20231218 (Red Hat 11.4.1
-3)]
Type 'copyright', 'credits' or
'license' for more information
IPython 8.21.0 -- An enhanced
Interactive Python. Type '?' for help.
In [1]: 'a' + 'b'
Out[1]: 'ab'
In [2]: 1+10
Out[2]: 11
In [3]: quit()
3. Entering quit() to the python or
ipython prompt gets you out and back to the
Linux command line.
Download CPSC223FinalExam2024.txt
by right-clicking on it, answer questions using a
text editor,
and turn it in by end of December 11 via D2L:
csc223 Final Exam (text file
format) due by 11:59 PM Wednesday December 11.
Assignments turned in late will receive a 10%
penalty per calendar day late. I need to get final
grades turned in to KU.
waveLeftWaveType
waveLeftDupl
waveRightWaveType
waveRightDupl
pcc
scc
abs(pcc-scc)
pulse
3
sine
3
-0.489243
-0.17092 0.318323
^^^Table 1: PearsonR (pcc) and SpearmanR (scc)
correlation measures between a pulse wave
with a duplication factor of 3 per
Assignments 2 & 4 and a sine wave with a
duplication factor of 3.
The pulse has squared corners and the sine
is rounded.
Figure 1: The two waveforms correlated in Table
1 above.
waveLeftWaveType
waveLeftDupl
waveRightWaveType
waveRightDupl
samples pcc
scc
sine
1
triangle
1
1023
0.992709 1
^^^Table 2: PearsonR (pcc) and SpearmanR (scc)
correlation measures between a triangle wave
with a duplication factor of 1 per
Assignments 2 & 4 and a sine wave with a
duplication factor of 1.
Figure 2: The two waveforms correlated with
Table 2 above.
Here are some URLs to libraries you imported and
used in Assignment 4 with a few added here.
https://docs.python.org/3.11/library/statistics.html
https://docs.python.org/3.11/library/statistics.html#statistics.mean
https://docs.python.org/3.11/library/statistics.html#statistics.pstdev
https://docs.python.org/3.11/library/statistics.html#statistics.median
https://docs.python.org/3.11/library/statistics.html#statistics.median_low
https://docs.python.org/3.11/library/statistics.html#statistics.median_high
https://docs.python.org/3.11/library/statistics.html#statistics.quantiles
https://docs.python.org/3.11/library/statistics.html#statistics.mode
https://scikit-learn.org/1.5/modules/generated/sklearn.metrics.mean_absolute_error.html
https://scikit-learn.org/1.5/modules/generated/sklearn.metrics.root_mean_squared_error.html
https://docs.scipy.org/doc/scipy-1.14.1/reference/generated/scipy.stats.pearsonr.html
https://docs.scipy.org/doc/scipy-1.14.1/reference/generated/scipy.stats.spearmanr.html#scipy.stats.spearmanr