Skip to content

MJChimal/Python-lectures-Notebooks

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

90 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Python lectures Notebooks

This is the repository of my Python lectures done at Instituto de Astronomia - UNAM

Most of the lectures are on this blog: http://python-astro.blogspot.mx/

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)
  2. 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 PyMySQL (PDF version)

About

Files for the Python lecture I give at IA-UNAM

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Jupyter Notebook 94.6%
  • HTML 4.7%
  • Other 0.7%