Workshop for CDSE Days, Monday, April 9, 2018, 8:30am-12:30pm.
John Ringland, Mathematics Department
Assisted by Aly Bittner and Tara Hudson
Contents
Experienced programmer in some other language (such as C++, Java, Matlab) with little to no experience with Python.
Two ways to ask questions:
expressive, versatile, free
Shift-Enter, Tab, Shift-Tab, Kernels, Cell types: markdown, code, Math in markdown, Export to rST
Format is JSON - easy to escape from, if ever necessary
Non-Python: ! for shell commands, % for magic commands
Computational environment, eventual successor to Jupyter Notebook
<,<=,==,!=, is
indentation
range()
start:stop:stride
negative and shorthands
in
split, replace, zfill
arguments to functions can be functions
functions can call themselves
functions can return functions
import foo import foo.bar as blah
from foo import bar from foo import *
example: glob
dir
os: creating, renaming, deleting folders and files
example: art
writing text to files
Exercise 2: reproduce a tartan
To start with, a simple checkerboard weave like this:
Exercise: Newton's method on cube roots of 1
solving linear systems, eigendata, etc.
matplotlib
Exercise 3: read & plot audio: black holes merge, audio file black_holes_merge.wav
Source: https://www.youtube.com/watch?v=599IgzzhhAs
bessel functions, elliptic integrals
forced damped oscillator
phones
Can call and be called by C, C++, Fortran, ...
ArcGIS, QGIS