Skip to content
Daniel Muthukrishna edited this page Jun 20, 2019 · 15 revisions

Topics In Python Reseach

Course Wiki

If you can do the following exercises then you do not need to come to this part of the course

Exercises

  • Cheat sheet: http://cheat-sheets.s3.amazonaws.com/for-mobile/linux-commands-cheat-sheet-new.pdf
  • Remove LaTeX compilation by-products (i.e. files ending in .log and .aux) in a directory hierarchy which is 10 levels deep (hint: find).
  • List all executable files in the current directory, including "hidden" ones.
  • List of directories in the current directory.
  • Write a shell script which outputs "filename is older" if filename is older than your ~/.bashrc and "filename is newer" it it is not older.

Files

  • c compilation example here.

If you can do the following exercises then you do not need to come to this part of the course

Exercises

  • Install anaconda (or miniconda)
  • Create a family (phylogenic) tree of a chosen animal using class inheritance
  • Write a program which computes the 100 first Fibonacci numbers and prints them out as a comma and space separated list, splitting the output into lines of as close as possible but no more than 80 characters long. Make sure your Fibonacci-generator is reusable and has unit tests.
  • Program Conway's Game of Life.

DAY 3

Morning I/O
Exercises

  • Save and load a 100x100x100 numpy array:
    1. On your own
    2. numpy functions
    3. h5py

Data Visualisation
Exercises

  • Save a datacube to a HDF5 file which can be read in by Paraview
  • Animate Conway's Game of Life

Afternoon Principal Component Analysis, Fast Fourier Transforms, Convolution
Exercises

  • Look at Scipy.Stats and write a hypothesis test if this is relevant to your project
  • Use data_generator.py in sample-answers to generate sample data and preform Principal Component Analysis on this.
  • Use convolution with a window function to improve the algorithm to calculate Conway's Game of Life.

DAY 4

Morning Markov Chains, Monti-Carlo
Also

Exercises

  • Write hypothesis test using scipy.stats
  • Preform PCA on dataset generated by data_generator.py. This must be run from the sample answers directory
  • Sample a square or finite domain uniformly

Afternoon [Machine Learning]

Exercises

DAY 5

Morning Optimisation
Exercises

  • Implement the steepest decent algorithm
  • Use to find Minimum of Rosenbrock Function

Afternoon Integration, ODEs, PDEs
Also

Exercises

  • ODE Initial Value Problem, solve x''(t) = - k \sin x(t)
  • ODE Boundary Value Problem, solve y''(x) = y'(x) + sin(x) exp(x), y(-pi) = 0, y(pi) = 1
  • ODE Boundary Value Problem, as above but with y(-pi) = 1, y'(pi) = 0
  • PDE Heat Equation with Source. solve Laplacian u(x, y) = exp(- 2 ((x - 0.5)^2 + (y - 0.5)^2)), u(x, 0) = 1, u(0, y) = 1 - y, u(x, 1) = u(1, y) = 0
  • PDE Heat Equation and Flow. Same Boundaries as above but with Laplacian u(x, y) = v(x, y) . grad u(x, y) + exp(- 2 ((x - 0.5)^2 + (y - 0.5)^2)), for some choice of v(x, y)
Clone this wiki locally