Python Installation & Basics

Python Installation & Basics

Python Installation & Basics Hiroki Sayama ([email protected]) Software Installation We will use Python and NetworkX for the exercises of computer programming, data processing and network analysis. We will need the following software installed to your computer: Enthought Canopy (pre-packaged free Python programming environment) o Obtain an installer either from the thumb drives available from the instructors, or from online (https://www.enthought.com/products/canopy/). Install it by double-clicking the installer file. NetworkX (network analysis module) o You can install this software from Enthought Canopy. Launch Enthought Canopy, select Package Manager, search for “networkx”, and then install it. Python Programming Basics Python Basics o "Hello, world!" o Using Python interactively o Writing a separate program code o How to get help (i.e., just Google it) Data Representation o Numbers o integer, real (floating point), complex o Variables and assignments o Numerical and logical operations o Arithmetic operators, =, <, >, <=, >=, is, not, and, or, in o Strings o Arithmetic operators, find, replace, split, etc. o Lists ("[ v1, v2, ...]") o Nested lists o len, min, max, sum, count, append, pop, sort(ed), reverse, filter, etc. o Slice operator (":") o Advanced topic: Dictionaries ("{ k1:v1, k2:v2, ...}") o Advanced topic: Sets ("{ v1, v2, ...}"), tuples ("( v1, v2, ...)") o Advanced topic: List/dictionary/set comprehension o Advanced topic: Classes and objects o Advanced topic: Graph, DiGraph objects Algorithm Representation o Indent-based syntax o Loops (while, for) o Flow control (if, else, elif) o User-defined functions (def) o Advanced topic: Local and global scopes of variables Other Topics o Modules o import, math, random, etc. o File I/O o open, close, read, write, etc. o reading/writing .csv files o Visualization (matplotlib’s plot, NetworkX’s draw) Online Resources The Python Tutorial http://docs.python.org/2/tutorial/ Library Reference http://docs.python.org/2/library/ matplotlib Documentation http://matplotlib.org/1.3.1/users/index.html NetworkX Documentation http://networkx.github.io/documentation/latest/ .

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    2 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us