Today we talked about counting the number of occurences of each different integer in an array of integers. We started with the assumption that the values ranged from 0 through 5. The challenge was to write a function countInts(A) that returned an array. For example, countInts(np.array([1,3,2,5,2,1]) should return np.array([0,2,2,1,0,1]) because 0 doesn't occur at all, 1 occurs twice, 2 occurs twice, 3 occurs once, 4 not at all, and 5 once. If you weren't in class you should think about the problem a little before reading on. You'll have to solve problems like this on the next test and on the final exam.
more...
Today we will consider the execution of a simple script..
more...
Today we talked about reading PDB files. The crazy format is documented in the assignment.
more...
Today we talked about finding pairs of points with constraints on their distance. This will be very helpful for your assignment 4.
more...
Transcript for today.
more...
Today we worked on understanding the scopes of variables in functions.
more...
Transcript for today. We began working on the
functions exercises.
Here is the code we wrote
. The transcript below just shows us loading it and running some of the functions. Remember you must %run the script each time you change it.
more...
Transcript for today.
more...
Transcript for today.
more...
Today we began looking a functions.
Here is a revised version of our scorch code
that uses a function to solve for the roots of the quadratic.
more...