Scientific Programming in Python

Size: px
Start display at page:

Download "Scientific Programming in Python"

Transcription

1 UCSD March 9, 2009

2 What is Python? Python in a very high level (scripting) language which has gained widespread popularity in recent years. It is:

3 What is Python? Python in a very high level (scripting) language which has gained widespread popularity in recent years. It is: cross platform

4 What is Python? Python in a very high level (scripting) language which has gained widespread popularity in recent years. It is: cross platform object oriented

5 What is Python? Python in a very high level (scripting) language which has gained widespread popularity in recent years. It is: cross platform object oriented open source

6 Why should I care?

7 Why should I care? You may need to use a computer to run simulations crunch data display data...

8 Why should I care? You may need to use a computer to run simulations crunch data display data... Python s 3 rd -party libraries can help you with these tasks.

9 Python s Scientific Libraries Python is enhanced by a large set of scientific libraries that are being actively developed. Suppose you want:

10 Python s Scientific Libraries Python is enhanced by a large set of scientific libraries that are being actively developed. Suppose you want: standard science and engineering functions or plotting (MATLAB) SciPy, Matplotlib

11 Python s Scientific Libraries Python is enhanced by a large set of scientific libraries that are being actively developed. Suppose you want: standard science and engineering functions or plotting (MATLAB) SciPy, Matplotlib a computer algebra system (Mathematica) SAGE

12 Python s Scientific Libraries Python is enhanced by a large set of scientific libraries that are being actively developed. Suppose you want: standard science and engineering functions or plotting (MATLAB) SciPy, Matplotlib a computer algebra system (Mathematica) SAGE data processing Modular toolkit for Data Processing (MDP)

13 Python s Scientific Libraries Python is enhanced by a large set of scientific libraries that are being actively developed. Suppose you want: standard science and engineering functions or plotting (MATLAB) SciPy, Matplotlib a computer algebra system (Mathematica) SAGE data processing Modular toolkit for Data Processing (MDP) bioinformatics functions Biopython

14 Python s Scientific Libraries Python is enhanced by a large set of scientific libraries that are being actively developed. Suppose you want: standard science and engineering functions or plotting (MATLAB) SciPy, Matplotlib a computer algebra system (Mathematica) SAGE data processing Modular toolkit for Data Processing (MDP) bioinformatics functions Biopython machine learning functions PyML, mlpy, SHOGUN

15 Python s Scientific Libraries Python is enhanced by a large set of scientific libraries that are being actively developed. Suppose you want: standard science and engineering functions or plotting (MATLAB) SciPy, Matplotlib a computer algebra system (Mathematica) SAGE data processing Modular toolkit for Data Processing (MDP) bioinformatics functions Biopython machine learning functions PyML, mlpy, SHOGUN neural nets Fast Artificial Neural Network (FANN) Library

16 Python s Scientific Libraries Python is enhanced by a large set of scientific libraries that are being actively developed. Suppose you want: standard science and engineering functions or plotting (MATLAB) SciPy, Matplotlib a computer algebra system (Mathematica) SAGE data processing Modular toolkit for Data Processing (MDP) bioinformatics functions Biopython machine learning functions PyML, mlpy, SHOGUN neural nets Fast Artificial Neural Network (FANN) Library artificial intelligence or robotics routines Python Robotics (Pyro)

17 Is it hard to learn?

18 Is it hard to learn?

19 Python vs MATLAB Advantages of MATLAB:

20 Python vs MATLAB Advantages of MATLAB: already widely used

21 Python vs MATLAB Advantages of MATLAB: already widely used designed specifically for scientific computing

22 Python vs MATLAB Advantages of MATLAB: already widely used designed specifically for scientific computing easy to find documentation

23 Python vs MATLAB Advantages of MATLAB: already widely used designed specifically for scientific computing easy to find documentation good IDE with debugging and profiling support out of the box

24 Python vs MATLAB Advantages of MATLAB: already widely used designed specifically for scientific computing easy to find documentation good IDE with debugging and profiling support out of the box Advantages of Python:

25 Python vs MATLAB Advantages of MATLAB: already widely used designed specifically for scientific computing easy to find documentation good IDE with debugging and profiling support out of the box Advantages of Python: open source means no limits on use

26 Python vs MATLAB Advantages of MATLAB: already widely used designed specifically for scientific computing easy to find documentation good IDE with debugging and profiling support out of the box Advantages of Python: open source means no limits on use appears to approximately superset MATLAB s functionality

27 Python vs MATLAB Advantages of MATLAB: already widely used designed specifically for scientific computing easy to find documentation good IDE with debugging and profiling support out of the box Advantages of Python: open source means no limits on use appears to approximately superset MATLAB s functionality modern language with support for object orientation

28 Python vs MATLAB Advantages of MATLAB: already widely used designed specifically for scientific computing easy to find documentation good IDE with debugging and profiling support out of the box Advantages of Python: open source means no limits on use appears to approximately superset MATLAB s functionality modern language with support for object orientation support for calling functions in other languages

29 Python Intro - Basics To get information on an object from the interpreter h e l p <o b j e c t > Commenting: Inline comments are preceded with # Block comments are surrounded with Code blocks are denoted with indentation: i f x == 2 : p r i n t x Python is dynamically typed: a = h e l l o # a i s a s t r i n g a = 4 # a i s now an i n t e g e r

30 Python Intro - Vectors and Matrices Many of these functions come from SciPy. from s c i p y import Vectors: N = 5 # a s c a l a r v = [ 1, 2, 3 ] # a l i s t v = a r r a y ( [ 1, 2, 3 ] ) # a column v e c t o r v = a r r a y ( [ [ 1 ], [ 2 ], [ 3 ] ] )# a column v e c t o r v = a r r a y ( [ [ 1, 2, 3 ] ] ) # a column v e c t o r v = t r a n s p o s e ( v ) # t r a n s p o s e a v e c t o r # ( row to column # or column to row ) v = arange ( 4,4) # a v e c t o r i n # a s p e c i f i e d range : v = p i arange ( 4,4)/4 v = arange ( 4,4,.5) # arange ( s t a r t, stop, s t e p ) v = [ ] # empty l i s t

31 Python Intro Matrices: m = z e r o s ( [ 2, 3 ] ) # a m a t r i x o f z e r o s v = ones ( [ 1, 3 ] ) # a m a t r i x o f ones v = rand ( 3, 1 ) # rand m a t r i x ( s e e a l s o randn ) m = eye ( 3 ) # i d e n t i t y m a t r i x (3 x3 )

32 Python Intro - Vectors and Matrices v = a r r a y ( [ 5, 6, 7 ] ) # a c c e s s a v e c t o r element v [ 2 ] # v e c t o r ( i n d e x ) a r r a y s a r e # zero i n d e x e d l e n ( v ) # number o f e l e m e n t s i n # a v e c t o r m = a r r a y ( [ [ 1, 2, 3 ], \ [ 4, 5, 6 ] ] ) # a 2 x3 m a t r i x m[ 1, 2 ] == m[ 1 ] [ 2 ] # a c c e s s a m a t r i x element # m a t r i x [ row, column ]

33 blah m[ 1, : ] # a c c e s s a m a t r i x row # ( bottom row ) m[ :, 0 ] # a c c e s s a m a t r i x column # ( l e f t column ) m. r e s h a p e ( [ 4, 1 ] ) # t u r n m a t r i x i n t o a column # v e c t o r ( c o n c a t e n a t e rows ) m. shape # s i z e o f a m a t r i x [ rows, c o l s ] m. shape [ 0 ] # number o f rows m. shape [ 1 ] # number o f columns z e r o s (m. shape ) # c r e a t e a new m a t r i x with # s i z e o f m m = a r r a y ( [ [ h e l l o, sum ], \ [ 1, 2 ] ] ) # put whatever you want # i n t o an a r r a y m[ 0, 1 ] (m[ 1 ] ) # c a l l sum on bottom row o f m

34 Python Intro - Vectors and Matrices Arithmetic operations performed on arrays are done element by element. a = a r r a y ( [ 1, 2, 3, 4 ] ) # v e c t o r 2 a # s c a l a r m u l t i p l i c a t i o n a / 4 # s c a l a r d i v i s i o n b = a r r a y ( [ 5, 6, 7, 8 ] ) # v e c t o r a + b # p o i n t w i s e v e c t o r a d d i t i o n a b # p o i n t w i s e v e c t o r s u b t r a c t i o n a 2 # p o i n t i s e v e c t o r s q u a r i n g a b # p o i n t w i s e v e c t o r m u l t i p l y a / b # p o i n t w i s e v e c t o r d i v i d e l o g ( a ) # p o i n t w i s e l o g a r i t h m around ( a r r a y ( [ [. 6 ], \ [. 5 ] ] ) ) # p o i n t w i s e r o u n d i n g # (. 5 rounds to 0)

35 Vector Operations a = a r r a y ( [ 1, 4, 6, 3 ] ) # v e c t o r sum ( a ) # sum o f v e c t o r e l e m e n t s mean ( a ) # mean o f v e c t o r e l e m e n t s v a r ( a ) # v a r i a n c e s t d ( a ) # s t a n d a r d d e v i a t i o n max( a ) # maximum a = a r r a y ( [ [ 1, 2, 3 ], \ [ 4, 5, 6 ] ] ) # m a t r i x mean ( a, 0 ) # mean o f each column amax ( a, 1 ) # max o f each row amax ( a ) # to o b t a i n max o f m a t r i x # note we use 2 # d i f f e r e n t max f u n c t i o n s

36 Matrix Operations dot ( t r a n s p o s e ( a r r a y ( [ 1, 2, 3 ] ) ), \ a r r a y ( [ 4, 5, 6 ] ) ) # row v e c t o r 1 x3 t i m e s column # v e c t o r 3 x1 r e s u l t s i n a # s i n g l e number, a l s o known # as dot / i n n e r product dot ( a r r a y ( [ [ 1 ], [ 2 ], [ 3 ] ] ), \ a r r a y ( [ [ 4, 5, 6 ] ] ) ) # column v e c t o r 3 x1 t i m e s row # v e c t o r 1 x3 r e s u l t s i n 3 x3 # matrix, a l s o known # as o u t e r p r oduct a = rand ( 3, 2 ) # 3 x2 m a t r i x b = rand ( 2, 4 ) # 2 x4 m a t r i x dot ( a, b ) # 3 x4 m a t r i x

37 Saving Your Work import c P i c k l e as p i c k l e # t h i s module l e t s you # s a v e and r e l o a d o b j e c t s f = open ( s a v e f i l e, w ) # open a r c h i v e f i l e p i c k l e. dump( obj, f ) # dump o b j e c t to a r c h i v e f. c l o s e ( ) # c l o s e a r c h i v e f i l e del o b j # c l e a r o b j e c t # from memory f = open ( s a v e f i l e, r ) # open a r c h i v e f i l e o b j = p i c k l e. l o a d ( f ) # read o b j e c t # from a r c h i v e f. c l o s e ( ) # c l o s e a r c h i v e f i l e

38 Relations and Control Example: given a list v, create a new list u with values equal to v if they are greater than 0, and equal to 0 if they less than or equal to 0. Using a for loop: v = [3,5, 2,5, 1,0] u = [ 0 ] l e n ( v ) # u i s a l l z e r o s f o r i i n range ( l e n ( v ) ) : i f v ( i ) > 0 : u ( i ) = v ( i ) Using list comprehension: v = [3,5, 2,5, 1,0] u = [ max( e, 0 ) f o r e i n v ]

39 Importing Functions Save the following code to mylib.py : def myfunc ( a, b ) : return a+b 2 Import and use myfunc. Note, we might need to configure PYTHONPATH. from mylib import myfunc myfunc ( 1, 2 ) myfunc ( b=2, a=1) # same a s above Python also supports class creation: c l a s s MyClass : def i n i t ( s e l f ) : p r i n t h e l l o! m y c l a s s = MyClass ( )

40 Plotting The library matplotlib / pylab is your friend: from p y l a b import xs = arange ( 2,2,.01) p l o t ( xs, s i n ( xs ) ) show ( )

41 Imaging We use the Python Imaging Library as well as matplotlib / pylab from p y l a b import import Image im = Image. open ( my image. j p g ) im. show ( ) # we can d i s p l a y the image ima = a r r a y ( im ) # t y p e c a s t i n g to a r r a y # e x t r a c t s p i x e l v a l u e s imr = Image. f r o m s t r i n g ( RGB,\ ( ima. shape [ 1 ], ima. shape [ 0 ] ), \ ima. t o s t r i n g ( ) ) # c o n v e r t a r r a y i n t o image img = ima. mean ( 2 ) # a v e r a g e c o l o r i n t e n s i t i e s # f o r each p i x e l imshow ( img ) autumn ( ) # s e t d e f a u l t colormap to autumn show ( )

42 How do I start? Many guides and tutorials are available online:

43 How do I start? Many guides and tutorials are available online: Dive Into Python python introduction for programmers

44 How do I start? Many guides and tutorials are available online: Dive Into Python python introduction for programmers A list of tutorials for Python and some of its many libraries can be found at

45 Questions?

Intro to scientific programming (with Python) Pietro Berkes, Brandeis University

Intro to scientific programming (with Python) Pietro Berkes, Brandeis University Intro to scientific programming (with Python) Pietro Berkes, Brandeis University Next 4 lessons: Outline Scientific programming: best practices Classical learning (Hoepfield network) Probabilistic learning

More information

Exercise 0. Although Python(x,y) comes already with a great variety of scientic Python packages, we might have to install additional dependencies:

Exercise 0. Although Python(x,y) comes already with a great variety of scientic Python packages, we might have to install additional dependencies: Exercise 0 Deadline: None Computer Setup Windows Download Python(x,y) via http://code.google.com/p/pythonxy/wiki/downloads and install it. Make sure that before installation the installer does not complain

More information

CUDAMat: a CUDA-based matrix class for Python

CUDAMat: a CUDA-based matrix class for Python Department of Computer Science 6 King s College Rd, Toronto University of Toronto M5S 3G4, Canada http://learning.cs.toronto.edu fax: +1 416 978 1455 November 25, 2009 UTML TR 2009 004 CUDAMat: a CUDA-based

More information

AMATH 352 Lecture 3 MATLAB Tutorial Starting MATLAB Entering Variables

AMATH 352 Lecture 3 MATLAB Tutorial Starting MATLAB Entering Variables AMATH 352 Lecture 3 MATLAB Tutorial MATLAB (short for MATrix LABoratory) is a very useful piece of software for numerical analysis. It provides an environment for computation and the visualization. Learning

More information

(!' ) "' # "*# "!(!' +,

(!' ) ' # *# !(!' +, MATLAB is a numeric computation software for engineering and scientific calculations. The name MATLAB stands for MATRIX LABORATORY. MATLAB is primarily a tool for matrix computations. It was developed

More information

CIS 192: Lecture 13 Scientific Computing and Unit Testing

CIS 192: Lecture 13 Scientific Computing and Unit Testing CIS 192: Lecture 13 Scientific Computing and Unit Testing Lili Dworkin University of Pennsylvania Scientific Computing I Python is really popular in the scientific and statistical computing world I Why?

More information

2+2 Just type and press enter and the answer comes up ans = 4

2+2 Just type and press enter and the answer comes up ans = 4 Demonstration Red text = commands entered in the command window Black text = Matlab responses Blue text = comments 2+2 Just type and press enter and the answer comes up 4 sin(4)^2.5728 The elementary functions

More information

CRASH COURSE PYTHON. Het begint met een idee

CRASH COURSE PYTHON. Het begint met een idee CRASH COURSE PYTHON nr. Het begint met een idee This talk Not a programming course For data analysts, who want to learn Python For optimizers, who are fed up with Matlab 2 Python Scripting language expensive

More information

Modeling with Python

Modeling with Python H Modeling with Python In this appendix a brief description of the Python programming language will be given plus a brief introduction to the Antimony reaction network format and libroadrunner. Python

More information

ANSA and μeta as a CAE Software Development Platform

ANSA and μeta as a CAE Software Development Platform ANSA and μeta as a CAE Software Development Platform Michael Giannakidis, Yianni Kolokythas BETA CAE Systems SA, Thessaloniki, Greece Overview What have we have done so far Current state Future direction

More information

Programming Languages & Tools

Programming Languages & Tools 4 Programming Languages & Tools Almost any programming language one is familiar with can be used for computational work (despite the fact that some people believe strongly that their own favorite programming

More information

Simulation Tools. Python for MATLAB Users I. Claus Führer. Automn 2009. Claus Führer Simulation Tools Automn 2009 1 / 65

Simulation Tools. Python for MATLAB Users I. Claus Führer. Automn 2009. Claus Führer Simulation Tools Automn 2009 1 / 65 Simulation Tools Python for MATLAB Users I Claus Führer Automn 2009 Claus Führer Simulation Tools Automn 2009 1 / 65 1 Preface 2 Python vs Other Languages 3 Examples and Demo 4 Python Basics Basic Operations

More information

Vectors VECTOR PRODUCT. Graham S McDonald. A Tutorial Module for learning about the vector product of two vectors. Table of contents Begin Tutorial

Vectors VECTOR PRODUCT. Graham S McDonald. A Tutorial Module for learning about the vector product of two vectors. Table of contents Begin Tutorial Vectors VECTOR PRODUCT Graham S McDonald A Tutorial Module for learning about the vector product of two vectors Table of contents Begin Tutorial c 2004 g.s.mcdonald@salford.ac.uk 1. Theory 2. Exercises

More information

Postprocessing with Python

Postprocessing with Python Postprocessing with Python Boris Dintrans (CNRS & University of Toulouse) dintrans@ast.obs-mip.fr Collaborator: Thomas Gastine (PhD) Outline Outline Introduction - what s Python and why using it? - Installation

More information

Computational Mathematics with Python

Computational Mathematics with Python Boolean Arrays Classes Computational Mathematics with Python Basics Olivier Verdier and Claus Führer 2009-03-24 Olivier Verdier and Claus Führer Computational Mathematics with Python 2009-03-24 1 / 40

More information

December 4, 2013 MATH 171 BASIC LINEAR ALGEBRA B. KITCHENS

December 4, 2013 MATH 171 BASIC LINEAR ALGEBRA B. KITCHENS December 4, 2013 MATH 171 BASIC LINEAR ALGEBRA B KITCHENS The equation 1 Lines in two-dimensional space (1) 2x y = 3 describes a line in two-dimensional space The coefficients of x and y in the equation

More information

Row Echelon Form and Reduced Row Echelon Form

Row Echelon Form and Reduced Row Echelon Form These notes closely follow the presentation of the material given in David C Lay s textbook Linear Algebra and its Applications (3rd edition) These notes are intended primarily for in-class presentation

More information

Part VI. Scientific Computing in Python

Part VI. Scientific Computing in Python Part VI Scientific Computing in Python Compact Course @ GRS, June 03-07, 2013 80 More on Maths Module math Constants pi and e Functions that operate on int and float All return values float ceil (x) floor

More information

Analysis of System Performance IN2072 Chapter M Matlab Tutorial

Analysis of System Performance IN2072 Chapter M Matlab Tutorial Chair for Network Architectures and Services Prof. Carle Department of Computer Science TU München Analysis of System Performance IN2072 Chapter M Matlab Tutorial Dr. Alexander Klein Prof. Dr.-Ing. Georg

More information

Python for Scientific Computing. http://bender.astro.sunysb.edu/classes/python-science

Python for Scientific Computing. http://bender.astro.sunysb.edu/classes/python-science http://bender.astro.sunysb.edu/classes/python-science Course Goals Simply: to learn how to use python to do Numerical analysis Data analysis Plotting and visualizations Symbol mathematics Write applications...

More information

Data structures for statistical computing in Python Wes McKinney SciPy 2010 McKinney () Statistical Data Structures in Python SciPy 2010 1 / 31 Environments for statistics and data analysis The usual suspects:

More information

Python. Python. 1 Python. M.Ulvrova, L.Pouilloux (ENS LYON) Informatique L3 Automne 2011 1 / 25

Python. Python. 1 Python. M.Ulvrova, L.Pouilloux (ENS LYON) Informatique L3 Automne 2011 1 / 25 Python 1 Python M.Ulvrova, L.Pouilloux (ENS LYON) Informatique L3 Automne 2011 1 / 25 Python makes you fly M.Ulvrova, L.Pouilloux (ENS LYON) Informatique L3 Automne 2011 2 / 25 Let s start ipython vs python

More information

Computational Mathematics with Python

Computational Mathematics with Python Numerical Analysis, Lund University, 2011 1 Computational Mathematics with Python Chapter 1: Basics Numerical Analysis, Lund University Claus Führer, Jan Erik Solem, Olivier Verdier, Tony Stillfjord Spring

More information

Introduction to MATLAB (Basics) Reference from: Azernikov Sergei mesergei@tx.technion.ac.il

Introduction to MATLAB (Basics) Reference from: Azernikov Sergei mesergei@tx.technion.ac.il Introduction to MATLAB (Basics) Reference from: Azernikov Sergei mesergei@tx.technion.ac.il MATLAB Basics Where to get help? 1) In MATLAB s prompt type: help, lookfor,helpwin, helpdesk, demos. 2) On the

More information

Python for Chemistry in 21 days

Python for Chemistry in 21 days minutes Python for Chemistry in 21 days Dr. Noel O'Boyle Dr. John Mitchell and Prof. Peter Murray-Rust UCC Talk, Sept 2005 Available at http://www-mitchell.ch.cam.ac.uk/noel/ Introduction This talk will

More information

Computational Mathematics with Python

Computational Mathematics with Python Computational Mathematics with Python Basics Claus Führer, Jan Erik Solem, Olivier Verdier Spring 2010 Claus Führer, Jan Erik Solem, Olivier Verdier Computational Mathematics with Python Spring 2010 1

More information

Introduction to Matlab

Introduction to Matlab Introduction to Matlab Social Science Research Lab American University, Washington, D.C. Web. www.american.edu/provost/ctrl/pclabs.cfm Tel. x3862 Email. SSRL@American.edu Course Objective This course provides

More information

SCIENTIFIC COMPUTING AND PROGRAMMING IN THE CLOUD USING OPEN SOURCE PLATFORMS: AN ILLUSTRATION USING WEIGHTED VOTING SYSTEMS

SCIENTIFIC COMPUTING AND PROGRAMMING IN THE CLOUD USING OPEN SOURCE PLATFORMS: AN ILLUSTRATION USING WEIGHTED VOTING SYSTEMS SCIENTIFIC COMPUTING AND PROGRAMMING IN THE CLOUD USING OPEN SOURCE PLATFORMS: AN ILLUSTRATION USING WEIGHTED VOTING SYSTEMS Mohamed I Jamaloodeen Georgia Gwinnet College School of Science and Technology

More information

Bachelor Degree in Informatics Engineering Master courses

Bachelor Degree in Informatics Engineering Master courses Bachelor Degree in Informatics Engineering Master courses Donostia School of Informatics The University of the Basque Country, UPV/EHU For more information: Universidad del País Vasco / Euskal Herriko

More information

Recall that two vectors in are perpendicular or orthogonal provided that their dot

Recall that two vectors in are perpendicular or orthogonal provided that their dot Orthogonal Complements and Projections Recall that two vectors in are perpendicular or orthogonal provided that their dot product vanishes That is, if and only if Example 1 The vectors in are orthogonal

More information

Chemical and Biological Engineering Calculations using Python 3. Jeffrey J. Heys

Chemical and Biological Engineering Calculations using Python 3. Jeffrey J. Heys Chemical and Biological Engineering Calculations using Python 3 Jeffrey J. Heys Copyright c 2014 Jeffrey Heys All rights reserved. This version is being made available at no cost. Please acknowledge access

More information

Advanced Topics: Biopython

Advanced Topics: Biopython Advanced Topics: Biopython Day Three Testing Peter J. A. Cock The James Hutton Institute, Invergowrie, Dundee, DD2 5DA, Scotland, UK 23rd 25th January 2012, Workshop on Genomics, Český Krumlov, Czech Republic

More information

An Introduction to APGL

An Introduction to APGL An Introduction to APGL Charanpal Dhanjal February 2012 Abstract Another Python Graph Library (APGL) is a graph library written using pure Python, NumPy and SciPy. Users new to the library can gain an

More information

Assignment 2: Option Pricing and the Black-Scholes formula The University of British Columbia Science One CS 2015-2016 Instructor: Michael Gelbart

Assignment 2: Option Pricing and the Black-Scholes formula The University of British Columbia Science One CS 2015-2016 Instructor: Michael Gelbart Assignment 2: Option Pricing and the Black-Scholes formula The University of British Columbia Science One CS 2015-2016 Instructor: Michael Gelbart Overview Due Thursday, November 12th at 11:59pm Last updated

More information

Course plan. MSc on Bioinformatics for Health Sciences. 2015-2016 Academic Year Qualification Master's Degree

Course plan. MSc on Bioinformatics for Health Sciences. 2015-2016 Academic Year Qualification Master's Degree Course plan MSc on Bioinformatics for Health Sciences 2015-2016 Academic Year Qualification Master's Degree 1. Description of the subject Subject name: Introduction to Programming with Perl Code: 31033

More information

Introduction to Python

Introduction to Python 1 Daniel Lucio March 2016 Creator of Python https://en.wikipedia.org/wiki/guido_van_rossum 2 Python Timeline Implementation Started v1.0 v1.6 v2.1 v2.3 v2.5 v3.0 v3.1 v3.2 v3.4 1980 1991 1997 2004 2010

More information

Computational Physics

Computational Physics Computational Physics Sheet 6, Computational Physics Course 17105 Professor: H. Ruhl, Exercises: N. Moschüring and N. Elkina Discussion of Solutions: Dec 03, 01, Room A49 Problem 1: Yee solver for Schrödinger

More information

Tutorial Program. 1. Basics

Tutorial Program. 1. Basics 1. Basics Working environment Dealing with matrices Useful functions Logical operators Saving and loading Data management Exercises 2. Programming Basics graphics settings - ex Functions & scripts Vectorization

More information

Advanced Computational Software

Advanced Computational Software Advanced Computational Software Scientific Libraries: Part 2 Blue Waters Undergraduate Petascale Education Program May 29 June 10 2011 Outline Quick review Fancy Linear Algebra libraries - ScaLAPACK -PETSc

More information

Session 15 OF, Unpacking the Actuary's Technical Toolkit. Moderator: Albert Jeffrey Moore, ASA, MAAA

Session 15 OF, Unpacking the Actuary's Technical Toolkit. Moderator: Albert Jeffrey Moore, ASA, MAAA Session 15 OF, Unpacking the Actuary's Technical Toolkit Moderator: Albert Jeffrey Moore, ASA, MAAA Presenters: Melissa Boudreau, FCAS Albert Jeffrey Moore, ASA, MAAA Christopher Kenneth Peek Yonasan Schwartz,

More information

Bachelor of Games and Virtual Worlds (Programming) Subject and Course Summaries

Bachelor of Games and Virtual Worlds (Programming) Subject and Course Summaries First Semester Development 1A On completion of this subject students will be able to apply basic programming and problem solving skills in a 3 rd generation object-oriented programming language (such as

More information

18.06 Problem Set 4 Solution Due Wednesday, 11 March 2009 at 4 pm in 2-106. Total: 175 points.

18.06 Problem Set 4 Solution Due Wednesday, 11 March 2009 at 4 pm in 2-106. Total: 175 points. 806 Problem Set 4 Solution Due Wednesday, March 2009 at 4 pm in 2-06 Total: 75 points Problem : A is an m n matrix of rank r Suppose there are right-hand-sides b for which A x = b has no solution (a) What

More information

Today's Topics. COMP 388/441: Human-Computer Interaction. simple 2D plotting. 1D techniques. Ancient plotting techniques. Data Visualization:

Today's Topics. COMP 388/441: Human-Computer Interaction. simple 2D plotting. 1D techniques. Ancient plotting techniques. Data Visualization: COMP 388/441: Human-Computer Interaction Today's Topics Overview of visualization techniques 1D charts, 2D plots, 3D+ techniques, maps A few guidelines for scientific visualization methods, guidelines,

More information

K-Means Clustering Tutorial

K-Means Clustering Tutorial K-Means Clustering Tutorial By Kardi Teknomo,PhD Preferable reference for this tutorial is Teknomo, Kardi. K-Means Clustering Tutorials. http:\\people.revoledu.com\kardi\ tutorial\kmean\ Last Update: July

More information

Programming Exercise 3: Multi-class Classification and Neural Networks

Programming Exercise 3: Multi-class Classification and Neural Networks Programming Exercise 3: Multi-class Classification and Neural Networks Machine Learning November 4, 2011 Introduction In this exercise, you will implement one-vs-all logistic regression and neural networks

More information

:Introducing Star-P. The Open Platform for Parallel Application Development. Yoel Jacobsen E&M Computing LTD yoel@emet.co.il

:Introducing Star-P. The Open Platform for Parallel Application Development. Yoel Jacobsen E&M Computing LTD yoel@emet.co.il :Introducing Star-P The Open Platform for Parallel Application Development Yoel Jacobsen E&M Computing LTD yoel@emet.co.il The case for VHLLs Functional / applicative / very high-level languages allow

More information

Linear Algebra Review. Vectors

Linear Algebra Review. Vectors Linear Algebra Review By Tim K. Marks UCSD Borrows heavily from: Jana Kosecka kosecka@cs.gmu.edu http://cs.gmu.edu/~kosecka/cs682.html Virginia de Sa Cogsci 8F Linear Algebra review UCSD Vectors The length

More information

Solution of Linear Systems

Solution of Linear Systems Chapter 3 Solution of Linear Systems In this chapter we study algorithms for possibly the most commonly occurring problem in scientific computing, the solution of linear systems of equations. We start

More information

Outline. hardware components programming environments. installing Python executing Python code. decimal and binary notations running Sage

Outline. hardware components programming environments. installing Python executing Python code. decimal and binary notations running Sage Outline 1 Computer Architecture hardware components programming environments 2 Getting Started with Python installing Python executing Python code 3 Number Systems decimal and binary notations running

More information

MATLAB Programming Tricks

MATLAB Programming Tricks MATLAB Programming Tricks Retreat 2015 Bad Überkingen Dominic Mai Why use MATLAB? Easy to write code - No type declarations needed - Memory management handled automatically - Structs for easy data keeping

More information

Python Programming: An Introduction to Computer Science

Python Programming: An Introduction to Computer Science Python Programming: An Introduction to Computer Science Chapter 1 Computers and Programs 1 Objectives To understand the respective roles of hardware and software in a computing system. To learn what computer

More information

From mathematics to a nice figure in a LaTeX document

From mathematics to a nice figure in a LaTeX document From mathematics to a nice figure in a L A T E Xdocument: a post-processing chain Matthieu Haefele High Level Support Team Max-Planck-Institut für Plasmaphysik, München, Germany Autrans, 26-30 Septembre

More information

Availability of the Program A free version is available of each (see individual programs for links).

Availability of the Program A free version is available of each (see individual programs for links). Choosing a Programming Platform Diane Hobenshield Tepylo, Lisa Floyd, and Steve Floyd (Computer Science and Mathematics teachers) The Tasks Working Group had many questions and concerns about choosing

More information

CE 504 Computational Hydrology Computational Environments and Tools Fritz R. Fiedler

CE 504 Computational Hydrology Computational Environments and Tools Fritz R. Fiedler CE 504 Computational Hydrology Computational Environments and Tools Fritz R. Fiedler 1) Operating systems a) Windows b) Unix and Linux c) Macintosh 2) Data manipulation tools a) Text Editors b) Spreadsheets

More information

2x + y = 3. Since the second equation is precisely the same as the first equation, it is enough to find x and y satisfying the system

2x + y = 3. Since the second equation is precisely the same as the first equation, it is enough to find x and y satisfying the system 1. Systems of linear equations We are interested in the solutions to systems of linear equations. A linear equation is of the form 3x 5y + 2z + w = 3. The key thing is that we don t multiply the variables

More information

Basic Concepts in Matlab

Basic Concepts in Matlab Basic Concepts in Matlab Michael G. Kay Fitts Dept. of Industrial and Systems Engineering North Carolina State University Raleigh, NC 769-7906, USA kay@ncsu.edu September 00 Contents. The Matlab Environment.

More information

How To Develop Software

How To Develop Software Software Development Basics Dr. Axel Kohlmeyer Associate Dean for Scientific Computing College of Science and Technology Temple University, Philadelphia http://sites.google.com/site/akohlmey/ a.kohlmeyer@temple.edu

More information

Robot Task-Level Programming Language and Simulation

Robot Task-Level Programming Language and Simulation Robot Task-Level Programming Language and Simulation M. Samaka Abstract This paper presents the development of a software application for Off-line robot task programming and simulation. Such application

More information

VB.NET Programming Fundamentals

VB.NET Programming Fundamentals Chapter 3 Objectives Programming Fundamentals In this chapter, you will: Learn about the programming language Write a module definition Use variables and data types Compute with Write decision-making statements

More information

KNIME TUTORIAL. Anna Monreale KDD-Lab, University of Pisa Email: annam@di.unipi.it

KNIME TUTORIAL. Anna Monreale KDD-Lab, University of Pisa Email: annam@di.unipi.it KNIME TUTORIAL Anna Monreale KDD-Lab, University of Pisa Email: annam@di.unipi.it Outline Introduction on KNIME KNIME components Exercise: Market Basket Analysis Exercise: Customer Segmentation Exercise:

More information

MATHEMATICS FOR ENGINEERS BASIC MATRIX THEORY TUTORIAL 2

MATHEMATICS FOR ENGINEERS BASIC MATRIX THEORY TUTORIAL 2 MATHEMATICS FO ENGINEES BASIC MATIX THEOY TUTOIAL This is the second of two tutorials on matrix theory. On completion you should be able to do the following. Explain the general method for solving simultaneous

More information

Why (and Why Not) to Use Fortran

Why (and Why Not) to Use Fortran Why (and Why Not) to Use Fortran p. 1/?? Why (and Why Not) to Use Fortran Instead of C++, Matlab, Python etc. Nick Maclaren University of Cambridge Computing Service nmm1@cam.ac.uk, 01223 334761 June 2012

More information

G563 Quantitative Paleontology. SQL databases. An introduction. Department of Geological Sciences Indiana University. (c) 2012, P.

G563 Quantitative Paleontology. SQL databases. An introduction. Department of Geological Sciences Indiana University. (c) 2012, P. SQL databases An introduction AMP: Apache, mysql, PHP This installations installs the Apache webserver, the PHP scripting language, and the mysql database on your computer: Apache: runs in the background

More information

Embedding Artificial Intelligence and Soft Computing in general purpose programming languages

Embedding Artificial Intelligence and Soft Computing in general purpose programming languages Embedding Artificial Intelligence and Soft Computing in general purpose programming languages Dr Wieslaw Pietruszkiewicz SDART Ltd Plan of presentation Problem Aim Intelligent software Examples Computer

More information

Department of Chemical Engineering ChE-101: Approaches to Chemical Engineering Problem Solving MATLAB Tutorial VI

Department of Chemical Engineering ChE-101: Approaches to Chemical Engineering Problem Solving MATLAB Tutorial VI Department of Chemical Engineering ChE-101: Approaches to Chemical Engineering Problem Solving MATLAB Tutorial VI Solving a System of Linear Algebraic Equations (last updated 5/19/05 by GGB) Objectives:

More information

Introduction to Computing I - MATLAB

Introduction to Computing I - MATLAB I - MATLAB Jonathan Mascie-Taylor (Slides originally by Quentin CAUDRON) Centre for Complexity Science, University of Warwick Outline 1 Preamble 2 Computing 3 Introductory MATLAB Variables and Syntax Plotting

More information

Some programming experience in a high-level structured programming language is recommended.

Some programming experience in a high-level structured programming language is recommended. Python Programming Course Description This course is an introduction to the Python programming language. Programming techniques covered by this course include modularity, abstraction, top-down design,

More information

A few useful MATLAB functions

A few useful MATLAB functions A few useful MATLAB functions Renato Feres - Math 350 Fall 2012 1 Uniform random numbers The Matlab command rand is based on a popular deterministic algorithm called multiplicative congruential method.

More information

Fall 2012 Q530. Programming for Cognitive Science

Fall 2012 Q530. Programming for Cognitive Science Fall 2012 Q530 Programming for Cognitive Science Aimed at little or no programming experience. Improve your confidence and skills at: Writing code. Reading code. Understand the abilities and limitations

More information

Comprehensive Course Syllabus

Comprehensive Course Syllabus Comprehensive Course Syllabus Computational Thinking Course Description: The course introduces students to the principles of computational thinking. Computational thinking is a way of solving problems,

More information

Introduction Installation Comparison. Department of Computer Science, Yazd University. SageMath. A.Rahiminasab. October9, 2015 1 / 17

Introduction Installation Comparison. Department of Computer Science, Yazd University. SageMath. A.Rahiminasab. October9, 2015 1 / 17 Department of Computer Science, Yazd University SageMath A.Rahiminasab October9, 2015 1 / 17 2 / 17 SageMath(previously Sage or SAGE) System for Algebra and Geometry Experimentation is mathematical software

More information

Beginner s Matlab Tutorial

Beginner s Matlab Tutorial Christopher Lum lum@u.washington.edu Introduction Beginner s Matlab Tutorial This document is designed to act as a tutorial for an individual who has had no prior experience with Matlab. For any questions

More information

Python Programming: An Introduction to Computer Science

Python Programming: An Introduction to Computer Science Python Programming: An Introduction to Computer Science Chapter 1 Computers and Programs 1 The Universal Machine n A computer -- a machine that stores and manipulates information under the control of a

More information

Using MATLAB to Measure the Diameter of an Object within an Image

Using MATLAB to Measure the Diameter of an Object within an Image Using MATLAB to Measure the Diameter of an Object within an Image Keywords: MATLAB, Diameter, Image, Measure, Image Processing Toolbox Author: Matthew Wesolowski Date: November 14 th 2014 Executive Summary

More information

Chaco: A Plotting Package for Scientists and Engineers. David C. Morrill Enthought, Inc.

Chaco: A Plotting Package for Scientists and Engineers. David C. Morrill Enthought, Inc. Chaco: A Plotting Package for Scientists and Engineers David C. Morrill Enthought, Inc. Introduction With packages such as Mathematica and MatLab, scientists and engineers already have a variety of high-quality

More information

15.062 Data Mining: Algorithms and Applications Matrix Math Review

15.062 Data Mining: Algorithms and Applications Matrix Math Review .6 Data Mining: Algorithms and Applications Matrix Math Review The purpose of this document is to give a brief review of selected linear algebra concepts that will be useful for the course and to develop

More information

Objectives. Python Programming: An Introduction to Computer Science. Lab 01. What we ll learn in this class

Objectives. Python Programming: An Introduction to Computer Science. Lab 01. What we ll learn in this class Python Programming: An Introduction to Computer Science Chapter 1 Computers and Programs Objectives Introduction to the class Why we program and what that means Introduction to the Python programming language

More information

MEng, BSc Computer Science with Artificial Intelligence

MEng, BSc Computer Science with Artificial Intelligence School of Computing FACULTY OF ENGINEERING MEng, BSc Computer Science with Artificial Intelligence Year 1 COMP1212 Computer Processor Effective programming depends on understanding not only how to give

More information

Component Ordering in Independent Component Analysis Based on Data Power

Component Ordering in Independent Component Analysis Based on Data Power Component Ordering in Independent Component Analysis Based on Data Power Anne Hendrikse Raymond Veldhuis University of Twente University of Twente Fac. EEMCS, Signals and Systems Group Fac. EEMCS, Signals

More information

Signal Processing First Lab 01: Introduction to MATLAB. 3. Learn a little about advanced programming techniques for MATLAB, i.e., vectorization.

Signal Processing First Lab 01: Introduction to MATLAB. 3. Learn a little about advanced programming techniques for MATLAB, i.e., vectorization. Signal Processing First Lab 01: Introduction to MATLAB Pre-Lab and Warm-Up: You should read at least the Pre-Lab and Warm-up sections of this lab assignment and go over all exercises in the Pre-Lab section

More information

Tentative NumPy Tutorial

Tentative NumPy Tutorial Tentative NumPy Tutorial This tutorial is unfinished. The original authors were not NumPy experts nor native English speakers so it needs reviewing. Please do not hesitate to click the edit button. You

More information

Chapter 12. Development Tools for Microcontroller Applications

Chapter 12. Development Tools for Microcontroller Applications Chapter 12 Development Tools for Microcontroller Applications Lesson 01 Software Development Process and Development Tools Step 1: Development Phases Analysis Design Implementation Phase 1 Phase 2 Phase

More information

Python programming guide for Earth Scientists. Maarten J. Waterloo and Vincent E.A. Post

Python programming guide for Earth Scientists. Maarten J. Waterloo and Vincent E.A. Post Python programming guide for Earth Scientists Maarten J. Waterloo and Vincent E.A. Post Amsterdam Critical Zone Hydrology group September 2015 Cover page: Meteorological tower in an abandoned agricultural

More information

Data Management: Best Practices. Michelle Craft Research IT Coordinator mcraft@discovery.wisc.edu http://cct-resources.discovery.wisc.

Data Management: Best Practices. Michelle Craft Research IT Coordinator mcraft@discovery.wisc.edu http://cct-resources.discovery.wisc. Data Management: Best Practices Michelle Craft Research IT Coordinator mcraft@discovery.wisc.edu http://cct-resources.discovery.wisc.edu Stanford University Libraries, Data Management Services library.stanford.edu/research/data-managementservices/data-best-practices

More information

Financial Econometrics MFE MATLAB Introduction. Kevin Sheppard University of Oxford

Financial Econometrics MFE MATLAB Introduction. Kevin Sheppard University of Oxford Financial Econometrics MFE MATLAB Introduction Kevin Sheppard University of Oxford October 21, 2013 2007-2013 Kevin Sheppard 2 Contents Introduction i 1 Getting Started 1 2 Basic Input and Operators 5

More information

Sample Solutions for Assignment 2.

Sample Solutions for Assignment 2. AMath 383, Autumn 01 Sample Solutions for Assignment. Reading: Chs. -3. 1. Exercise 4 of Chapter. Please note that there is a typo in the formula in part c: An exponent of 1 is missing. It should say 4

More information

1 Topic. 2 Scilab. 2.1 What is Scilab?

1 Topic. 2 Scilab. 2.1 What is Scilab? 1 Topic Data Mining with Scilab. I know the name "Scilab" for a long time (http://www.scilab.org/en). For me, it is a tool for numerical analysis. It seemed not interesting in the context of the statistical

More information

Chapter 15 Functional Programming Languages

Chapter 15 Functional Programming Languages Chapter 15 Functional Programming Languages Introduction - The design of the imperative languages is based directly on the von Neumann architecture Efficiency (at least at first) is the primary concern,

More information

14:440:127 Introduction to Computers for Engineers. Notes for Lecture 06

14:440:127 Introduction to Computers for Engineers. Notes for Lecture 06 14:440:127 Introduction to Computers for Engineers Notes for Lecture 06 Rutgers University, Spring 2010 Instructor- Blase E. Ur 1 Loop Examples 1.1 Example- Sum Primes Let s say we wanted to sum all 1,

More information

SAGE, the open source CAS to end all CASs?

SAGE, the open source CAS to end all CASs? SAGE, the open source CAS to end all CASs? Thomas Risse Faculty of Electrical and Electronics Engineering and Computer Sciences, Bremen University of Applied Sciences, Germany Abstract SAGE, the 'Software

More information

Arithmetic and Algebra of Matrices

Arithmetic and Algebra of Matrices Arithmetic and Algebra of Matrices Math 572: Algebra for Middle School Teachers The University of Montana 1 The Real Numbers 2 Classroom Connection: Systems of Linear Equations 3 Rational Numbers 4 Irrational

More information

Adaptive Sampling and the Autonomous Ocean Sampling Network: Bringing Data Together With Skill

Adaptive Sampling and the Autonomous Ocean Sampling Network: Bringing Data Together With Skill Adaptive Sampling and the Autonomous Ocean Sampling Network: Bringing Data Together With Skill Lev Shulman, University of New Orleans Mentors: Paul Chandler, Jim Bellingham, Hans Thomas Summer 2003 Keywords:

More information

Linear Algebra Notes

Linear Algebra Notes Linear Algebra Notes Chapter 19 KERNEL AND IMAGE OF A MATRIX Take an n m matrix a 11 a 12 a 1m a 21 a 22 a 2m a n1 a n2 a nm and think of it as a function A : R m R n The kernel of A is defined as Note

More information

Matrix Multiplication

Matrix Multiplication Matrix Multiplication CPS343 Parallel and High Performance Computing Spring 2016 CPS343 (Parallel and HPC) Matrix Multiplication Spring 2016 1 / 32 Outline 1 Matrix operations Importance Dense and sparse

More information

Analysis Programs DPDAK and DAWN

Analysis Programs DPDAK and DAWN Analysis Programs DPDAK and DAWN An Overview Gero Flucke FS-EC PNI-HDRI Spring Meeting April 13-14, 2015 Outline Introduction Overview of Analysis Programs: DPDAK DAWN Summary Gero Flucke (DESY) Analysis

More information

Solving Systems of Linear Equations

Solving Systems of Linear Equations LECTURE 5 Solving Systems of Linear Equations Recall that we introduced the notion of matrices as a way of standardizing the expression of systems of linear equations In today s lecture I shall show how

More information

Plug. & Play. Various ECUs tested by automated sequences. dspace Magazine 3/2009 dspace GmbH, Paderborn, Germany info@dspace.com www.dspace.

Plug. & Play. Various ECUs tested by automated sequences. dspace Magazine 3/2009 dspace GmbH, Paderborn, Germany info@dspace.com www.dspace. page 34 Delphi Diesel systems Plug & Play Various ECUs tested by automated sequences page 35 Delphi Diesel Systems has successfully developed automated integration and feature tests for various ECUs for

More information

Introduction Our choice Example Problem Final slide :-) Python + FEM. Introduction to SFE. Robert Cimrman

Introduction Our choice Example Problem Final slide :-) Python + FEM. Introduction to SFE. Robert Cimrman Python + FEM Introduction to SFE Robert Cimrman Department of Mechanics & New Technologies Research Centre University of West Bohemia Plzeň, Czech Republic April 3, 2007, Plzeň 1/22 Outline 1 Introduction

More information

Big Data Paradigms in Python

Big Data Paradigms in Python Big Data Paradigms in Python San Diego Data Science and R Users Group January 2014 Kevin Davenport! http://kldavenport.com kldavenportjr@gmail.com @KevinLDavenport Thank you to our sponsors: Setting up

More information