CRASH COURSE PYTHON. Het begint met een idee

Size: px
Start display at page:

Download "CRASH COURSE PYTHON. Het begint met een idee"

Transcription

1 CRASH COURSE PYTHON nr. Het begint met een idee

2 This talk Not a programming course For data analysts, who want to learn Python For optimizers, who are fed up with Matlab 2

3 Python Scripting language expensive computations typically in compiled modules such as matrix multiplication, optimization, classification Faster Python code: Numba construct (or Cython) Support for functions and OOP (classes, abstract classes, polymorphism, inheritance; but no encapsulation) Direct competitors: R, Julia, Matlab 3

4 Zen of Python Beautiful is better than ugly. Explicit is better than implicit. Simple is better than complex. Complex is better than complicated. Flat is better than nested. Sparse is better than dense. Readability counts. Special cases aren't special enough to break the rules. Although practicality beats purity. Errors should never pass silently. Unless explicitly silenced. 4

5 Python 2 or 3? 1994: Python : Python 2 (backward compatible) 2008: Python 3 Most pronounced difference: Python 2: print hello world! Python 3: print( hello world! ) Strength of Python: broad availability of modules Many modules have been updated for Python 3 5 Some people still use Python 2

6 Installing Python Windows users: use winpython Has MKL for fast linear algebra, and many preinstalled modules Portable, so extract & go Ships with the Spyder editor for coding and debugging and a compiler for new modules winpython 3.4 is currently recommended (3.5 does not (yet) ship with a compiler) Mac users OS X ships with Python 2.7 (and depends on it, do not update to 3) Python 3 can be installed alongside Linux Ubuntu ships with both Python 2.7 and Python 3.4 Commands: python & python3 6

7 Installing modules Mac/Linux/POSIX-compatible systems: run pip from the terminal e.g.: pip install cylp WinPython: run WinPython Command Prompt.exe and use pip For dependencies that require a shell script (./configure ): add the folder winpython/share/mingwpy/bin to the path install msys from mingw.org start msys (C:\MinGW\msys\1.0\msys.bat) Configure&compile the dependency 7

8 Running Python The editor probably has a hotkey (F5 in Spyder) Shell command: python filename.py Alternative: python (runs commands as they are entered) 8

9 Crash course Data type Initialize empty Initialize with data List x = [] x = [1,2,5] Tuple - x = (1,2,5) Set x = set() x = {1,2,5} Dict x = {} x = {"one": 1, "two": 2, "five": 5} String x = "" x = "hello world" 9

10 Precision Integers have infinite precision Floats have finite precision use decimal/float/mpmath modules for arbitrary precision >> print(2**1000)

11 Creating a list Code x = [0,1,2,3,4,5,6,7,8,9,10] print(x) x = range(11) print(x) print(list(x)) Output [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10] range(0, 11) [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10] range(n) is list-like internally it is an object that can be converted to a list range(int(1e10)) requires a few bytes instead of 74.5 GB 11

12 Loops Code for i in [1,2,3]: print(i) while i < 5: i += 1 print(i) Output No curly braces or end for Structure is derived from level of indentation One statement per line No semicolons required 12

13 Functions Code def fun(name, greeting='hi', me='evil caterpillar'): print(greeting + ' ' + name + ', this is ' + me) return 0 Output Hi group, this is Python fun('group', me='python') All arguments are named: fun(name= group ) Naming useful for optional arguments Return is optional 13

14 Functions Code def trick_me(a,b,c): a.append('o') b.append('o') c += 1 Output ['m', 'n', 'o', 'o'] ['m', 'n', 'o', 'o'] 1 x = ['m','n'] y = x z = 1 trick_me(x,y,z) print(x,y,z) 14 Behavior depends on whether type is mutable variables are pointers memory gets overwritten for mutable types only String, int, double, tuple are immutable List, set, dict are mutable y=list(x) creates a shallow copy (y = copy.deepcopy(x) when x contains mutable data)

15 List comprehensions Creating a list with squares: 0, 1, 4,, 100 Naive code x = [] for i in range(11): x.append(i*i) Idiomatic Python x = [i*i for i in range(11)] Creating a list of even numbers 6, 8, 10, 12, 14 Naive code x = [] for i in range(6,15): if i % 2 == 0: x.append(i) Idiomatic Python x = [i for i in range(6,15) if i%2==0] # or x = [i for i in range(6,15,2)] 15

16 One-liner example Find the last ten digits of the series: (projecteuler.net) >> print(str(sum([k**k for k in range(1,1001)]))[-10:]) [k**k for k in range(1,1001)] creates the terms sum(.) takes the sum str(.) converts the argument to a string [-10:] takes a substring 16

17 Modules Matlab replacements scipy (free, linear algebra) matplotlib (free, graphing) Optimization cylp (free, linear and mixed integer optimization) pyipopt (free, convex optimization) gurobi / cplex (academic license) 17 Data mining pandas (free, importing and slicing data) scikit-learn (free, machine learning) xgboost (free, gradient boosting) takes less than 20 lines to create a cross-validated ensemble of classifiers

18 Recap Example: function, for-loop, range, comment def take_sum(s): sum = 0 for i in S: sum += i return sum print(take_sum(range(7))) # outputs 21 Example: named arguments def fun(name, greeting='hi', me='evil caterpillar'): print(greeting + ' ' + name + ', this is ' + me) return 0 18 fun('group', me='python')

19 Data mining Reading data with pandas Visualization with matplotlib Machine learning with scikit-learn 19

20 Reading data Pandas offers read_csv, read_excel, read_sql, read_json, read_html, read_sas, etc read_* returns pandas data structure: DataFrame Having data in DataFrame is useful filtering, combining, grouping, sorting to_csv, to_excel, etc (for, e.g., converting csv to json) 20

21 Example: reading csv file CSV file id,feat_1,feat_2,feat_3,feat_4,feat_5,target 1,1,0,0,0,0,1 2,0,0,0,0,0,0 3,0,0,0,0,0,0 4,1,0,0,1,6,0 5,0,0,0,0,0,1 Code import pandas filename = 'train.csv' X = pandas.read_csv(filename, sep=",") y = X.target X.drop(['target', 'id'], axis=1, inplace=true) 21

22 Filtering data CSV file id,feat_1,feat_2,feat_3,feat_4,feat_5,target 1,1,0,0,0,0,1 2,0,0,0,0,0,0 3,0,0,0,0,0,0 4,1,0,0,1,6,0 5,0,0,0,0,0,1 Code filename = 'train.csv' data = pandas.read_csv(filename) print(data[0:2]) output: id feat_1 feat_2 feat_3 feat_4 feat_5 target

23 Filtering data CSV file id,feat_1,feat_2,feat_3,feat_4,feat_5,target 1,1,0,0,0,0,1 2,0,0,0,0,0,0 3,0,0,0,0,0,0 4,1,0,0,1,6,0 5,0,0,0,0,0,1 Code filename = 'train.csv' data = pandas.read_csv(filename) print(data[data.feat_1 == 1]) output: id feat_1 feat_2 feat_3 feat_4 feat_5 target

24 Visualization Code data[data.feat_2<=5].feat_2.plot(kind='hist') # since the data takes few distinct values: data[data.feat_2<=5].feat_2.value_counts().sort_index().plot(kind='bar') 24

25 Grouping Code import numpy as np pandas.set_option('display.precision',2) for feat_2_value,group in data.groupby('feat_2'): # group is the DataFrame data[feat_2 == feat_2_value] data.groupby('feat_2').aggregate(pandas.series.nunique) # other aggregation functions: np.min, np.max, np.sum, np.std id feat_1 feat_3 feat_4 feat_5 target feat_

26 Example: time series Code import pandas import numpy as np ts = pandas.series(np.random.randn(1000), \ index=pandas.date_range('1/1/2000', periods=1000)) ts = ts.cumsum() ts.plot() print(ts.mean()) # output:

27 Example: large data set Suppose csv file is 100 GB and has thousands of columns Subset of three columns is manageable Code infile = 'train.csv' outfile = output.xlsx df = pandas.dataframe() # chunksize is the number of rows to read per iteration for data in pandas.read_csv(infile, chunksize=100): data = data[['feat_1', 'feat_2', 'target']] df = pandas.concat([df,data]) writer = pandas.excelwriter(outfile) df.to_excel(writer, 'Sheet1') writer.save() 27

28 Logistic regression Code from sklearn import cross_validation,linear_model from sklearn.metrics import log_loss filename = 'train.csv' X = pandas.read_csv(filename, sep=",") y = X.target X.drop(['target', 'id'], axis=1, inplace=true) y[y==1] = 0 y[y>1] = 1 X,X_test,y,y_test = cross_validation.train_test_split(x, y, test_size=0.5) clf = linear_model.logisticregression() clf.fit(x,y) prediction = clf.predict_proba(x_test) print(log_loss(y_test,prediction)) # output: ; log_loss is in in [0, 34.5] # 0 for perfect fit, 0.7 for constant p=0.5, 34.5 for all wrong 28

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

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

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

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

Introduction to Python for Text Analysis

Introduction to Python for Text Analysis Introduction to Python for Text Analysis Jennifer Pan Institute for Quantitative Social Science Harvard University (Political Science Methods Workshop, February 21 2014) *Much credit to Andy Hall and Learning

More information

Unlocking the True Value of Hadoop with Open Data Science

Unlocking the True Value of Hadoop with Open Data Science Unlocking the True Value of Hadoop with Open Data Science Kristopher Overholt Solution Architect Big Data Tech 2016 MinneAnalytics June 7, 2016 Overview Overview of Open Data Science Python and the Big

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

Scientific Programming in Python

Scientific Programming in Python UCSD March 9, 2009 What is Python? Python in a very high level (scripting) language which has gained widespread popularity in recent years. It is: What is Python? Python in a very high level (scripting)

More information

ESCI 386 Scientific Programming, Analysis and Visualization with Python. Lesson 5 Program Control

ESCI 386 Scientific Programming, Analysis and Visualization with Python. Lesson 5 Program Control ESCI 386 Scientific Programming, Analysis and Visualization with Python Lesson 5 Program Control 1 Interactive Input Input from the terminal is handled using the raw_input() function >>> a = raw_input('enter

More information

Advanced analytics at your hands

Advanced analytics at your hands 2.3 Advanced analytics at your hands Neural Designer is the most powerful predictive analytics software. It uses innovative neural networks techniques to provide data scientists with results in a way previously

More information

Introduction to Python

Introduction to Python Introduction to Python Sophia Bethany Coban Problem Solving By Computer March 26, 2014 Introduction to Python Python is a general-purpose, high-level programming language. It offers readable codes, and

More information

Big Data and Analytics by Seema Acharya and Subhashini Chellappan Copyright 2015, WILEY INDIA PVT. LTD. Introduction to Pig

Big Data and Analytics by Seema Acharya and Subhashini Chellappan Copyright 2015, WILEY INDIA PVT. LTD. Introduction to Pig Introduction to Pig Agenda What is Pig? Key Features of Pig The Anatomy of Pig Pig on Hadoop Pig Philosophy Pig Latin Overview Pig Latin Statements Pig Latin: Identifiers Pig Latin: Comments Data Types

More information

Scientific Programming, Analysis, and Visualization with Python. Mteor 227 Fall 2015

Scientific Programming, Analysis, and Visualization with Python. Mteor 227 Fall 2015 Scientific Programming, Analysis, and Visualization with Python Mteor 227 Fall 2015 Python The Big Picture Interpreted General purpose, high-level Dynamically type Multi-paradigm Object-oriented Functional

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

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

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

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

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

A Comparison of C, MATLAB, and Python as Teaching Languages in Engineering

A Comparison of C, MATLAB, and Python as Teaching Languages in Engineering A Comparison of C, MATLAB, and Python as Teaching Languages in Engineering Hans Fangohr University of Southampton, Southampton SO17 1BJ, UK fangohr@soton.ac.uk Abstract. We describe and compare the programming

More information

Embedded Systems. Review of ANSI C Topics. A Review of ANSI C and Considerations for Embedded C Programming. Basic features of C

Embedded Systems. Review of ANSI C Topics. A Review of ANSI C and Considerations for Embedded C Programming. Basic features of C Embedded Systems A Review of ANSI C and Considerations for Embedded C Programming Dr. Jeff Jackson Lecture 2-1 Review of ANSI C Topics Basic features of C C fundamentals Basic data types Expressions Selection

More information

Machine Learning in Python with scikit-learn. O Reilly Webcast Aug. 2014

Machine Learning in Python with scikit-learn. O Reilly Webcast Aug. 2014 Machine Learning in Python with scikit-learn O Reilly Webcast Aug. 2014 Outline Machine Learning refresher scikit-learn How the project is structured Some improvements released in 0.15 Ongoing work for

More information

The Clean programming language. Group 25, Jingui Li, Daren Tuzi

The Clean programming language. Group 25, Jingui Li, Daren Tuzi The Clean programming language Group 25, Jingui Li, Daren Tuzi The Clean programming language Overview The Clean programming language first appeared in 1987 and is still being further developed. It was

More information

We will learn the Python programming language. Why? Because it is easy to learn and many people write programs in Python so we can share.

We will learn the Python programming language. Why? Because it is easy to learn and many people write programs in Python so we can share. LING115 Lecture Note Session #4 Python (1) 1. Introduction As we have seen in previous sessions, we can use Linux shell commands to do simple text processing. We now know, for example, how to count words.

More information

I PUC - Computer Science. Practical s Syllabus. Contents

I PUC - Computer Science. Practical s Syllabus. Contents I PUC - Computer Science Practical s Syllabus Contents Topics 1 Overview Of a Computer 1.1 Introduction 1.2 Functional Components of a computer (Working of each unit) 1.3 Evolution Of Computers 1.4 Generations

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

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

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

6.170 Tutorial 3 - Ruby Basics

6.170 Tutorial 3 - Ruby Basics 6.170 Tutorial 3 - Ruby Basics Prerequisites 1. Have Ruby installed on your computer a. If you use Mac/Linux, Ruby should already be preinstalled on your machine. b. If you have a Windows Machine, you

More information

Scalable Data Analysis in R. Lee E. Edlefsen Chief Scientist UserR! 2011

Scalable Data Analysis in R. Lee E. Edlefsen Chief Scientist UserR! 2011 Scalable Data Analysis in R Lee E. Edlefsen Chief Scientist UserR! 2011 1 Introduction Our ability to collect and store data has rapidly been outpacing our ability to analyze it We need scalable data analysis

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

Introduction to Python for Econometrics, Statistics and Data Analysis. Kevin Sheppard University of Oxford

Introduction to Python for Econometrics, Statistics and Data Analysis. Kevin Sheppard University of Oxford Introduction to Python for Econometrics, Statistics and Data Analysis Kevin Sheppard University of Oxford Tuesday 5 th August, 2014 - 2012, 2013, 2014 Kevin Sheppard 2 Changes since the Second Edition

More information

Crash Dive into Python

Crash Dive into Python ECPE 170 University of the Pacific Crash Dive into Python 2 Lab Schedule Ac:vi:es Assignments Due Today Lab 8 Python Due by Oct 26 th 5:00am Endianness Lab 9 Tuesday Due by Nov 2 nd 5:00am Network programming

More information

CME 193: Introduction to Scientific Python Lecture 8: Unit testing, more modules, wrap up

CME 193: Introduction to Scientific Python Lecture 8: Unit testing, more modules, wrap up CME 193: Introduction to Scientific Python Lecture 8: Unit testing, more modules, wrap up Sven Schmit stanford.edu/~schmit/cme193 8: Unit testing, more modules, wrap up 8-1 Contents Unit testing More modules

More information

Python Loops and String Manipulation

Python Loops and String Manipulation WEEK TWO Python Loops and String Manipulation Last week, we showed you some basic Python programming and gave you some intriguing problems to solve. But it is hard to do anything really exciting until

More information

Introduction to Java

Introduction to Java Introduction to Java The HelloWorld program Primitive data types Assignment and arithmetic operations User input Conditional statements Looping Arrays CSA0011 Matthew Xuereb 2008 1 Java Overview A high

More information

vmprof Documentation Release 0.1 Maciej Fijalkowski, Antonio Cuni, Sebastian Pawlus

vmprof Documentation Release 0.1 Maciej Fijalkowski, Antonio Cuni, Sebastian Pawlus vmprof Documentation Release 0.1 Maciej Fijalkowski, Antonio Cuni, Sebastian Pawlus January 23, 2016 Contents 1 Introduction 1 1.1 Requirements............................................... 1 1.2 Installation................................................

More information

Python Basics. S.R. Doty. August 27, 2008. 1 Preliminaries 4 1.1 What is Python?... 4 1.2 Installation and documentation... 4

Python Basics. S.R. Doty. August 27, 2008. 1 Preliminaries 4 1.1 What is Python?... 4 1.2 Installation and documentation... 4 Python Basics S.R. Doty August 27, 2008 Contents 1 Preliminaries 4 1.1 What is Python?..................................... 4 1.2 Installation and documentation............................. 4 2 Getting

More information

PYTHON Basics http://hetland.org/writing/instant-hacking.html

PYTHON Basics http://hetland.org/writing/instant-hacking.html CWCS Workshop May 2009 PYTHON Basics http://hetland.org/writing/instant-hacking.html Python is an easy to learn, modern, interpreted, object-oriented programming language. It was designed to be as simple

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

University of Hull Department of Computer Science. Wrestling with Python Week 01 Playing with Python

University of Hull Department of Computer Science. Wrestling with Python Week 01 Playing with Python Introduction Welcome to our Python sessions. University of Hull Department of Computer Science Wrestling with Python Week 01 Playing with Python Vsn. 1.0 Rob Miles 2013 Please follow the instructions carefully.

More information

Introduction to the data.table package in R

Introduction to the data.table package in R Introduction to the data.table package in R Revised: September 18, 2015 (A later revision may be available on the homepage) Introduction This vignette is aimed at those who are already familiar with creating

More information

An Incomplete C++ Primer. University of Wyoming MA 5310

An Incomplete C++ Primer. University of Wyoming MA 5310 An Incomplete C++ Primer University of Wyoming MA 5310 Professor Craig C. Douglas http://www.mgnet.org/~douglas/classes/na-sc/notes/c++primer.pdf C++ is a legacy programming language, as is other languages

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

CS 1133, LAB 2: FUNCTIONS AND TESTING http://www.cs.cornell.edu/courses/cs1133/2015fa/labs/lab02.pdf

CS 1133, LAB 2: FUNCTIONS AND TESTING http://www.cs.cornell.edu/courses/cs1133/2015fa/labs/lab02.pdf CS 1133, LAB 2: FUNCTIONS AND TESTING http://www.cs.cornell.edu/courses/cs1133/2015fa/labs/lab02.pdf First Name: Last Name: NetID: The purpose of this lab is to help you to better understand functions:

More information

MAS 500 Intelligence Tips and Tricks Booklet Vol. 1

MAS 500 Intelligence Tips and Tricks Booklet Vol. 1 MAS 500 Intelligence Tips and Tricks Booklet Vol. 1 1 Contents Accessing the Sage MAS Intelligence Reports... 3 Copying, Pasting and Renaming Reports... 4 To create a new report from an existing report...

More information

Exercise 4 Learning Python language fundamentals

Exercise 4 Learning Python language fundamentals Exercise 4 Learning Python language fundamentals Work with numbers Python can be used as a powerful calculator. Practicing math calculations in Python will help you not only perform these tasks, but also

More information

Hands-On Data Science with R Dealing with Big Data. Graham.Williams@togaware.com. 27th November 2014 DRAFT

Hands-On Data Science with R Dealing with Big Data. Graham.Williams@togaware.com. 27th November 2014 DRAFT Hands-On Data Science with R Dealing with Big Data Graham.Williams@togaware.com 27th November 2014 Visit http://handsondatascience.com/ for more Chapters. In this module we explore how to load larger datasets

More information

CSCE 110 Programming I Basics of Python: Variables, Expressions, and Input/Output

CSCE 110 Programming I Basics of Python: Variables, Expressions, and Input/Output CSCE 110 Programming Basics of Python: Variables, Expressions, and nput/output Dr. Tiffani L. Williams Department of Computer Science and Engineering Texas A&M University Fall 2011 Python Python was developed

More information

Moving from CS 61A Scheme to CS 61B Java

Moving from CS 61A Scheme to CS 61B Java Moving from CS 61A Scheme to CS 61B Java Introduction Java is an object-oriented language. This document describes some of the differences between object-oriented programming in Scheme (which we hope you

More information

2! Multimedia Programming with! Python and SDL

2! Multimedia Programming with! Python and SDL 2 Multimedia Programming with Python and SDL 2.1 Introduction to Python 2.2 SDL/Pygame: Multimedia/Game Frameworks for Python Literature: G. van Rossum and F. L. Drake, Jr., An Introduction to Python -

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

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

Android Application Development Course Program

Android Application Development Course Program Android Application Development Course Program Part I Introduction to Programming 1. Introduction to programming. Compilers, interpreters, virtual machines. Primitive data types, variables, basic operators,

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

AIMMS 4.0. Portable component Linux Intel version. Release Notes for Build 4.9. Visit our web site www.aimms.com for regular updates AIMMS

AIMMS 4.0. Portable component Linux Intel version. Release Notes for Build 4.9. Visit our web site www.aimms.com for regular updates AIMMS AIMMS 4.0 Portable component Linux Intel version Release Notes for Build 4.9 Visit our web site www.aimms.com for regular updates AIMMS September 2, 2015 Contents Contents 2 1 System Overview of the Intel

More information

Programming and Software Development CTAG Alignments

Programming and Software Development CTAG Alignments Programming and Software Development CTAG Alignments This document contains information about four Career-Technical Articulation Numbers (CTANs) for Programming and Software Development Career-Technical

More information

Sources: On the Web: Slides will be available on:

Sources: On the Web: Slides will be available on: C programming Introduction The basics of algorithms Structure of a C code, compilation step Constant, variable type, variable scope Expression and operators: assignment, arithmetic operators, comparison,

More information

Object Oriented Software Design

Object Oriented Software Design Object Oriented Software Design Introduction to Java - II Giuseppe Lipari http://retis.sssup.it/~lipari Scuola Superiore Sant Anna Pisa September 14, 2011 G. Lipari (Scuola Superiore Sant Anna) Introduction

More information

Fast Analytics on Big Data with H20

Fast Analytics on Big Data with H20 Fast Analytics on Big Data with H20 0xdata.com, h2o.ai Tomas Nykodym, Petr Maj Team About H2O and 0xdata H2O is a platform for distributed in memory predictive analytics and machine learning Pure Java,

More information

Crash Dive into Python

Crash Dive into Python ECPE 170 University of the Pacific Crash Dive into Python 2 Lab Schedule Ac:vi:es Assignments Due Today Lab 11 Network Programming Due by Dec 1 st 5:00am Python Lab 12 Next Week Due by Dec 8 th 5:00am

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

Computer Science 217

Computer Science 217 Computer Science 217 Midterm Exam Fall 2009 October 29, 2009 Name: ID: Instructions: Neatly print your name and ID number in the spaces provided above. Pick the best answer for each multiple choice question.

More information

Computing Concepts with Java Essentials

Computing Concepts with Java Essentials 2008 AGI-Information Management Consultants May be used for personal purporses only or by libraries associated to dandelon.com network. Computing Concepts with Java Essentials 3rd Edition Cay Horstmann

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

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

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

Ensembles and PMML in KNIME

Ensembles and PMML in KNIME Ensembles and PMML in KNIME Alexander Fillbrunn 1, Iris Adä 1, Thomas R. Gabriel 2 and Michael R. Berthold 1,2 1 Department of Computer and Information Science Universität Konstanz Konstanz, Germany First.Last@Uni-Konstanz.De

More information

INFORMATION BROCHURE Certificate Course in Web Design Using PHP/MySQL

INFORMATION BROCHURE Certificate Course in Web Design Using PHP/MySQL INFORMATION BROCHURE OF Certificate Course in Web Design Using PHP/MySQL National Institute of Electronics & Information Technology (An Autonomous Scientific Society of Department of Information Technology,

More information

Introduction to Apache Pig Indexing and Search

Introduction to Apache Pig Indexing and Search Large-scale Information Processing, Summer 2014 Introduction to Apache Pig Indexing and Search Emmanouil Tzouridis Knowledge Mining & Assessment Includes slides from Ulf Brefeld: LSIP 2013 Organizational

More information

NetworkX: Network Analysis with Python

NetworkX: Network Analysis with Python NetworkX: Network Analysis with Python Salvatore Scellato Full tutorial presented at the XXX SunBelt Conference NetworkX introduction: Hacking social networks using the Python programming language by Aric

More information

Scientific Programming with Python. Randy M. Wadkins, Ph.D. Asst. Prof. of Chemistry & Biochem.

Scientific Programming with Python. Randy M. Wadkins, Ph.D. Asst. Prof. of Chemistry & Biochem. Scientific Programming with Python Randy M. Wadkins, Ph.D. Asst. Prof. of Chemistry & Biochem. What is Python? Python for computers is: a scripting language a programming language interpreted, so it

More information

Informatica e Sistemi in Tempo Reale

Informatica e Sistemi in Tempo Reale Informatica e Sistemi in Tempo Reale Introduction to C programming Giuseppe Lipari http://retis.sssup.it/~lipari Scuola Superiore Sant Anna Pisa October 25, 2010 G. Lipari (Scuola Superiore Sant Anna)

More information

Scoping (Readings 7.1,7.4,7.6) Parameter passing methods (7.5) Building symbol tables (7.6)

Scoping (Readings 7.1,7.4,7.6) Parameter passing methods (7.5) Building symbol tables (7.6) Semantic Analysis Scoping (Readings 7.1,7.4,7.6) Static Dynamic Parameter passing methods (7.5) Building symbol tables (7.6) How to use them to find multiply-declared and undeclared variables Type checking

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

Simply Accounting Intelligence Tips and Tricks Booklet Vol. 1

Simply Accounting Intelligence Tips and Tricks Booklet Vol. 1 Simply Accounting Intelligence Tips and Tricks Booklet Vol. 1 1 Contents Accessing the SAI reports... 3 Running, Copying and Pasting reports... 4 Creating and linking a report... 5 Auto e-mailing reports...

More information

Homework 4 Statistics W4240: Data Mining Columbia University Due Tuesday, October 29 in Class

Homework 4 Statistics W4240: Data Mining Columbia University Due Tuesday, October 29 in Class Problem 1. (10 Points) James 6.1 Problem 2. (10 Points) James 6.3 Problem 3. (10 Points) James 6.5 Problem 4. (15 Points) James 6.7 Problem 5. (15 Points) James 6.10 Homework 4 Statistics W4240: Data Mining

More information

CS1112 Spring 2014 Project 4. Objectives. 3 Pixelation for Identity Protection. due Thursday, 3/27, at 11pm

CS1112 Spring 2014 Project 4. Objectives. 3 Pixelation for Identity Protection. due Thursday, 3/27, at 11pm CS1112 Spring 2014 Project 4 due Thursday, 3/27, at 11pm You must work either on your own or with one partner. If you work with a partner you must first register as a group in CMS and then submit your

More information

Instructional Design Framework CSE: Unit 1 Lesson 1

Instructional Design Framework CSE: Unit 1 Lesson 1 Instructional Design Framework Stage 1 Stage 2 Stage 3 If the desired end result is for learners to then you need evidence of the learners ability to then the learning events need to. Stage 1 Desired Results

More information

Python for Data Analysis and Visualiza4on. Fang (Cherry) Liu, Ph.D fang.liu@oit.gatech.edu PACE Gatech July 2013

Python for Data Analysis and Visualiza4on. Fang (Cherry) Liu, Ph.D fang.liu@oit.gatech.edu PACE Gatech July 2013 Python for Data Analysis and Visualiza4on Fang (Cherry) Liu, Ph.D PACE Gatech July 2013 Outline System requirements and IPython Why use python for data analysis and visula4on Data set US baby names 1880-2012

More information

Relational Database: Additional Operations on Relations; SQL

Relational Database: Additional Operations on Relations; SQL Relational Database: Additional Operations on Relations; SQL Greg Plaxton Theory in Programming Practice, Fall 2005 Department of Computer Science University of Texas at Austin Overview The course packet

More information

Python Lists and Loops

Python Lists and Loops WEEK THREE Python Lists and Loops You ve made it to Week 3, well done! Most programs need to keep track of a list (or collection) of things (e.g. names) at one time or another, and this week we ll show

More information

Unix Shell Scripts. Contents. 1 Introduction. Norman Matloff. July 30, 2008. 1 Introduction 1. 2 Invoking Shell Scripts 2

Unix Shell Scripts. Contents. 1 Introduction. Norman Matloff. July 30, 2008. 1 Introduction 1. 2 Invoking Shell Scripts 2 Unix Shell Scripts Norman Matloff July 30, 2008 Contents 1 Introduction 1 2 Invoking Shell Scripts 2 2.1 Direct Interpretation....................................... 2 2.2 Indirect Interpretation......................................

More information

LEARNING TO PROGRAM WITH PYTHON. Richard L. Halterman

LEARNING TO PROGRAM WITH PYTHON. Richard L. Halterman LEARNING TO PROGRAM WITH PYTHON Richard L. Halterman Copyright 2011 Richard L. Halterman. All rights reserved. i Contents 1 The Context of Software Development 1 1.1 Software............................................

More information

Car Insurance. Prvák, Tomi, Havri

Car Insurance. Prvák, Tomi, Havri Car Insurance Prvák, Tomi, Havri Sumo report - expectations Sumo report - reality Bc. Jan Tomášek Deeper look into data set Column approach Reminder What the hell is this competition about??? Attributes

More information

Parallel and Large Scale Learning with scikit-learn

Parallel and Large Scale Learning with scikit-learn Parallel and Large Scale Learning with scikit-learn Data Science London Meetup - Mar. 2013 About me Regular contributor to scikit-learn Interested in NLP, Computer Vision, Predictive Modeling & ML in general

More information

arrays C Programming Language - Arrays

arrays C Programming Language - Arrays arrays So far, we have been using only scalar variables scalar meaning a variable with a single value But many things require a set of related values coordinates or vectors require 3 (or 2, or 4, or more)

More information

dedupe Documentation Release 1.0.0 Forest Gregg, Derek Eder, and contributors

dedupe Documentation Release 1.0.0 Forest Gregg, Derek Eder, and contributors dedupe Documentation Release 1.0.0 Forest Gregg, Derek Eder, and contributors January 04, 2016 Contents 1 Important links 3 2 Contents 5 2.1 API Documentation...........................................

More information

Operation Count; Numerical Linear Algebra

Operation Count; Numerical Linear Algebra 10 Operation Count; Numerical Linear Algebra 10.1 Introduction Many computations are limited simply by the sheer number of required additions, multiplications, or function evaluations. If floating-point

More information

Google Cloud Data Platform & Services. Gregor Hohpe

Google Cloud Data Platform & Services. Gregor Hohpe Google Cloud Data Platform & Services Gregor Hohpe All About Data We Have More of It Internet data more easily available Logs user & system behavior Cheap Storage keep more of it 3 Beyond just Relational

More information

Analysis Tools and Libraries for BigData

Analysis Tools and Libraries for BigData + Analysis Tools and Libraries for BigData Lecture 02 Abhijit Bendale + Office Hours 2 n Terry Boult (Waiting to Confirm) n Abhijit Bendale (Tue 2:45 to 4:45 pm). Best if you email me in advance, but I

More information

Introduction to Python

Introduction to Python Caltech/LEAD Summer 2012 Computer Science Lecture 2: July 10, 2012 Introduction to Python The Python shell Outline Python as a calculator Arithmetic expressions Operator precedence Variables and assignment

More information

An introduction to Python Programming for Research

An introduction to Python Programming for Research An introduction to Python Programming for Research James Hetherington November 4, 2015 Contents 1 Introduction 15 1.1 Why teach Python?......................................... 15 1.1.1 Why Python?.........................................

More information

Big Data Analytics with Spark and Oscar BAO. Tamas Jambor, Lead Data Scientist at Massive Analytic

Big Data Analytics with Spark and Oscar BAO. Tamas Jambor, Lead Data Scientist at Massive Analytic Big Data Analytics with Spark and Oscar BAO Tamas Jambor, Lead Data Scientist at Massive Analytic About me Building a scalable Machine Learning platform at MA Worked in Big Data and Data Science in the

More information

Example of a Java program

Example of a Java program Example of a Java program class SomeNumbers static int square (int x) return x*x; public static void main (String[] args) int n=20; if (args.length > 0) // change default n = Integer.parseInt(args[0]);

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

PostgreSQL Functions By Example

PostgreSQL Functions By Example Postgre joe.conway@credativ.com credativ Group January 20, 2012 What are Functions? Introduction Uses Varieties Languages Full fledged SQL objects Many other database objects are implemented with them

More information

CLC Server Command Line Tools USER MANUAL

CLC Server Command Line Tools USER MANUAL CLC Server Command Line Tools USER MANUAL Manual for CLC Server Command Line Tools 2.5 Windows, Mac OS X and Linux September 4, 2015 This software is for research purposes only. QIAGEN Aarhus A/S Silkeborgvej

More information