Wednesday, August 20, 2014

Introduction to Numpy

2014 Python lecture. Part II


The introduction to Numpy can be seen here:
https://github.com/Morisset/Python-lectures-Notebooks/blob/master/Notebooks/intro_numpy.ipynb

The topics that are presented are:

  • 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.
Any comments are welcome.
Chris.Morisset a t Gmail.com

Wednesday, August 13, 2014

Python: Basics

2014 Python lecture. Part I


The introduction to Python I'm giving at IA-UNAM is accessible here:

https://github.com/Morisset/Python-lectures-Notebooks/blob/master/Notebooks/intro_Python.ipynb

I will modify this notebook during the lecture (August 2014), so reload it to have the latest version.

The topics of this first lecture are:
  • 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
If you want to have an interactive session with this lecture using the ipython notebook facilities, follow the link above and download the ipynb file (download button at the right top of the web page). Save the file in a directory from where you execute the following (you must have a recent version of ipython installed):
ipython notebook
It should open a new tab in your web browser, with the list of ipynb files in the directory. Click on the one you want, will open a new tab similar to the first one, but this one is executed on YOUR computer, it means you are able to interact with the commands. You can change the commands, and execute a cell by SHIFT-ENTER. You can add comments in new cells, and save the result.

Any comments are welcome.

Thursday, August 7, 2014

Brief introduction to Python

2014 Python lecture. Part 0


Back to the Python lecture, I want to share here the very quick introduction I gave before starting to play with python: https://github.com/Morisset/Python-lectures-Notebooks/blob/master/Notebooks/Intro_1.pdf
You may want to install python from Ureka from this site: http://ssb.stsci.edu/ureka/