This is the repository of my Python lectures give at Instituto de Astronomia - UNAM since 2012
The available lectures are the following:
- Using python as a calculator
- assignments
- comments
- types
- complex numbers
- booleans
- printing strings
- strings
- Tuples, lists and dictionaries
- Blocks
- List and dictionary comprehension
- Functions, procedures
- Scripting
- Importing libraries
- The Array class
- create an array
- 1D, 2D 3D arrays
- creating array from scratch
- arrays share memory (views)
- random generator
- timing a command
- slicing arrays
- assignments
- using masks
- the where function
- some operations with arrays
- broadcasting
- calling scripts
- structured arrays and record arrays
- NaN other ANSI values.
- Reading a simple ASCII file
- How to treat special rows (comments, header)
- classical way
- using numpy.loadtxt
- using numpy.genfromtxt
- Dealing with missing data
- Data in a fixed size format
- Writing files
- simple method
- Pickle files (python format)
- FITS files
- Simple plot
- Controlling colors and symbols
- Overplot
- Fixing axes limits
- Labels, titles
- Legends
- The object oriented way to use Matplotlib
- Scatter
- log plots
- Multiple plots
- Everything is object
- Error bars
- Sharing axes
- Histograms
- Boxplots
- Ticks, axes and spines
- A plot inside a plot
- Play with all the objects of a plot
- Filled regions
- 2D-histograms
- 2D data sets and images
- Contour
- 3D scatter plots
- Saving plots
- Access and clear the current figure and axe
- What's happen when not in a Notebook? plt.show() and plt.ion() commands
- Some useful methods
- nanmean
- constants
- Integrations
- Interpolations
- 2D-interpolations
- data fitting
- multivariate estimation
- time and datetime
- timeit
- os
- sys
- subprocess
- glob
- re
- urllib2
- constants and units
- data table
- Downloading from CDS
- Coordinates
- Modeling
- Optimization (PDF version)
- Calling Fortran (PDF version)
- Sending requests to MySQL and receiving the result from python, using SQLalchemy (PDF version)
- See MySQL.pdf
- connect to database
- using pandas to easy access
- querying Vizier
- querying MAST
- catalogs
- Machine Learning
- See Machine Learning.pdf
- One Notebook comparing Artificial Neural Network to Polynomial fit
- Notebook from Miguel Angel Aragon lecture on redshift determination
- Notebook from Miguel Angel Aragon lecture on Galaxy classification