Python & NetworkX 2013. 3 Youn-Hee Han

Slides:



Advertisements
Similar presentations
Guy Griffiths. General purpose interpreted programming language Widely used by scientists and programmers of all stripes Supported by many 3 rd -party.
Advertisements

Python tutorial for scientific computing Steve Byrnes 16 March 2012.
Python for Science Shane Grigsby. What is python? Why python? Interpreted, object oriented language Free and open source Focus is on readability Fast.
Geoprocessing with GDAL and Numpy in Python Delong Zhao
Facilitate – Collaborate – Educate Emily Wolin Northwestern University.
Russell Taylor Lecturer in Computing & Business Studies.
By. What advantages has it? The Reasons for Choosing Python  Python is free  It is object-oriented  It is interpreted  It is operating-system independent.
Python plotting for lab folk Only the stuff you need to know to make publishable figures of your data. For all else: ask Sourish.
 1 Basic Data Visualization. IPython An interactive shell to execute Python script. Run from a shell; ipython 2.
IMAGE PROCESSING LIBRARY (PIL) This is a package that you can import into python and it has quite a few methods that you can process image files with.
What is R By: Wase Siddiqui. Introduction R is a programming language which is used for statistical computing and graphics. “R is a language and environment.
OpenAlea An OpenSource platform for plant modeling C. Pradal, S. Dufour-Kowalski, F. Boudon, C. Fournier, C. Godin.
MLOSS: Whistler 2008 scientific visualisation for python John Hunter Tradelink Chicago
Introducing the Python programming language to the SMEDG community By Rupert Osborn H&S Consultants.
Company Overview for GDF Suez December 29, Enthought’s Business Enthought provides products and consulting services for scientific software solutions.
Introduction to Python By Neil Cook Twitter: njcuk Slides/Notes:
418512: Computer Programming Languages Lecture 7 Pramook Khungurn TexPoint fonts used in EMF. Read the TexPoint manual before you delete this box.: A AAAA.
Parallel Interactive Computing with PyTrilinos and IPython Bill Spotz, SNL (Brian Granger, Tech-X Corporation) November 8, 2007 Trilinos Users Group Meeting.
Scientific Computing Beyond Matlab Nov 19, 2012 Jason Su.
Scientific Computing with NumPy & SciPy NumPy Installation and Documentation  Not much on the home page—don’t buy the guide, it’s.
Ch 1. A Python Q&A Session Spring Why do people use Python? Software quality Developer productivity Program portability Support libraries Component.
FLUKA GUI Status FLUKA Meeting CERN, 10/7/2006.
SCIRun and SPA integration status Steven G. Parker Ayla Khan Oscar Barney.
Visualization UW CSE 140 Winter matplotlib Strives to emulate MATLAB – Pro: familiar to MATLAB users – Pro: powerful – Con: not the best design.
Python Mini-Course University of Oklahoma Department of Psychology Lesson 21 NumPy 6/11/09 Python Mini-Course: Lesson 21 1.
BOĞAZİÇİ UNIVERSITY DEPARTMENT OF MANAGEMENT INFORMATION SYSTEMS MATLAB AS A DATA MINING ENVIRONMENT.
Scientific Python Numpy Linear Algebra Matrices Scipy Signal Processing Optimization IPython Interactive Console Matplotlib Plotting Sympy Symbolic Math.
Ch 1. A Python Q&A Session. Why do people use Python? Software Quality Developer productivity Program portability Support Libraries Component integration.
Python Crash Course Numpy & MatplotLib Sterrenkundig Practicum 2 V1.0 dd Hour 3.
CIS 601 Fall 2003 Introduction to MATLAB Longin Jan Latecki Based on the lectures of Rolf Lakaemper and David Young.
9/2/2015BCHB Edwards Introduction to Python BCHB524 Lecture 1.
Practical Kinetics Exercise 0: Getting Started Objectives: 1.Install Python and IPython Notebook 2.print “Hello World!”
Matplotlib SANTHOSH Boggarapu.
First appeared Features Popular uses Basic This language emphasises on ease of use, allowing general purpose programming to those with a small amount of.
1 Support for Scientific Computing People: Bruce Beckles Nick Maclaren Services: Courses Advice.
Python Scripting for Computational Science CPS 5401 Fall 2014 Shirley Moore, Instructor October 6,
CS 5163 Introduction to Data Science
Introduction to python
Numerical and Scientific Computing Part 2
PH2150 Scientific Computing Skills
Python for data analysis Prakhar Amlathe Utah State University
CSC227: Operating Systems
Khang Lam Daniel Limas Kevin Castillo Juan Battini
MET4750 Techniques for Earth System Modeling
CSC391/691 Intro to OpenCV Dr. Rongzhong Li Fall 2016
IPYTHON AND MATPLOTLIB Python for computational science
DATA MINING Python.
Introduction to Information Security
PH2150 Scientific Computing Skills
Network Visualization
Python for Scientific Computing
Visualization UW CSE 160 Winter 2016.
Python plotting curves chapter 10_5
Visualization UW CSE 160 Winter 2017.
Matplotlib.
EMSE 6574 – Programming for Analytics: Python 101 – Python Enviornments Joel Klein.
Use of Python Scripts to Compare and Contrast Photo Images
Python Basics Wen-Yen Hsu, Hsiao-Lung Chan Dept Electrical Engineering
Discrete-Event Simulation and Performance Evaluation
Python Crash Course CSC 576: Data Science.
Simulation And Modeling
Python Users Group University of South Carolina
Visualization UW CSE 160 Spring 2015.
Python for Data Analysis
Matplotlib and Pandas
DATA MINING Python.
Web Application Development Using PHP
Presentation transcript:

Python & NetworkX Youn-Hee Han

Why Python?  Python has been considered as a “godsend” to all developers.  It miraculously combines all the good things we always wanted –It is incredibly fast –It makes it easy to develop complex yet robust enterprise-level systems –It is designed to maintain clarity as development expands.  It enables “exploratory programming”

Installing Python 2.7 & NetworkX 1.7

VirtualBox and Python  Environment Recommendation  Ubuntu in VirtualBox –In this material… Ubuntu Python

iPython  iPython ( –It is an enhanced Python shell and an architecture for interactive parallel computing. –It has everything to make your Python life much easier, from tab completion to inline code inspection and interactive debugging. –In addition, IPython has a special pylab mode for matplotlib. –Terminal –Qt Console –HTML Notebook  Just run: –easy_install ipython

NetworkX  NetworkX ( –It is a Python language software package for the creation, manipulation, and study of the structure, dynamics, and functions of complex networks.  Just run: –easy_install networkx

numpy and matplotlib  numpy ( –It is the fundamental Python package for scientific computing with Python. –It contains among other things: a powerful N-dimensional array object sophisticated (broadcasting) functions tools for integrating C/C++ and Fortran code useful linear algebra, Fourier transform, and random number capabilities  matplotlib ( –It is a python 2D plotting library which produces publication quality figures in a variety of hardcopy formats and interactive environments across platforms.  Just run: –easy_install numpy –easy_install matplotlib

numpy and matplotlib  Graphic Library  backend control – my-drawings-although-i-call-pyplot-showhttp://stackoverflow.com/questions/ /matplotlib-does-not-show- my-drawings-although-i-call-pyplot-show –Location of “matplotlibrc” file /usr/local/lib/python2.7/dist-packages/matplotlib py2.7-linux- i686.egg/matplotlib/mpl-data/matplotlibrc  Just run –easy_install PyGTK  [Note] In MAC OS, you use X11 #backend : Agg backend : GTK3Agg

Test Code  Simple Test Code –ipython simple.py import networkx as net import matplotlib.pyplot as plt g=net.Graph() g.add_edge('a','b') net.draw(g) plt.show() simple.py

Test Code  Basic Animation import numpy as np import matplotlib.pyplot as plt import matplotlib.animation as animation def update_line(num, data, line): line.set_data(data[...,:num]) return line, fig1 = plt.figure() data = np.random.rand(2, 25) l, = plt.plot([], [], 'r-') plt.xlim(0, 1) plt.ylim(0, 1) plt.xlabel('x') plt.title('test') line_ani = animation.FuncAnimation(fig1, update_line, 25, fargs=(data, l), interval=50, blit=True) #line_ani.save('lines.mp4') fig2 = plt.figure() x = np.arange(-9, 10) y = np.arange(-9, 10).reshape(-1, 1) base = np.hypot(x, y) ims = [] for add in np.arange(15): ims.append((plt.pcolor(x, y, base + add, norm=plt.Normalize(0, 30)),)) im_ani = animation.ArtistAnimation(fig2, ims, interval=50, repeat_delay=3000, blit=True) #im_ani.save('im.mp4', metadata={'artist':'Guido'}) plt.show() basic_animation.py