Skip to content

Latest commit

 

History

History
151 lines (124 loc) · 4.32 KB

README.rst

File metadata and controls

151 lines (124 loc) · 4.32 KB

Python lectures Notebooks

This is the repository of my Python lectures give at Instituto de Astronomia - UNAM since 2012

The available lectures are the following:

  1. Introduction to python (PDF version)
  • 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
  1. Introduction to Numpy (PDF version)
  • 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.
  1. Interacting with files (PDF version)
  • 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
  1. How to make plots, images, 3D, etc, using Matplotlib (PDF version)
  • 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
  1. Introduction to Scipy (PDF version)
  • Some useful methods
  • nanmean
  • constants
  • Integrations
  • Interpolations
  • 2D-interpolations
  • data fitting
  • multivariate estimation
  1. Usefull libraries (PDF version)
  • time and datetime
  • timeit
  • os
  • sys
  • subprocess
  • glob
  • re
  • urllib2
  1. The astropy library (PDF version)
  • constants and units
  • data table
  • Downloading from CDS
  • Coordinates
  • Modeling
  1. Object Oriented programing (PDF version)
  • use functions to do simple jobs
  • but use objects when things start to be more complex
  • define classes, objects, attributes, methods, etc...
  • use *args and **kwargs in functions calls
  • use the class variables
  • add functionalities to classes and objects
  • use class inheritance
  • use attributes properties
  1. Optimization (PDF version)
  2. Calling Fortran (PDF version)
  3. 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
  1. Using astroquery (PDF version)
  • querying Vizier
  • querying MAST
  • catalogs
  1. Machine Learning