Using Python for Scienti c Computing
Using Python for Scientific Computing
Session 3 - NumPy, SciPy, Matplotlib
Felix Steffenhagen
University of Freiburg
May 4, 2011
Inhalt
1 NumPy 2 SciPy 3 Plotting and Data Visualization
Felix Steffenhagen (Uni Freiburg)
Using Python for Scientific Computing
2011 2 / 37
Overview
Felix Steffenhagen (Uni Freiburg)
Using Python for Scientific Computing
2011 3 / 37
What is NumPy?
Fundamental package for scientific computing in Python Provides multidimensional arrays, matrices and polynom objects Fast operations on arrays through vectorized functions Differences to Python sequences:
Fixed size at creation All elements of the same data type greater variety on numerical datatypes (e.g. int8, int32, uint32, float64) highly efficient (implemented in C) base for many other scientific related packages
Felix Steffenhagen (Uni Freiburg)
Using Python for Scientific Computing
2011 4 / 37
Python is slow(er) ...
Simple test: Multiply two arrays of length 10.000.000
pure Python
import time
l = 10000000 start = time.time() a, b = range(l), range(l) c = [] for i in a:
c.append(a[i] * b[i]) t = time.time() - start print("Duration: %s" % t)
Using numpy
import numpy as np import time
l = 10000000 start = time.time() a = np.arange(l) b = np.arange(l) c=a*b t = time.time() - start print("Duration: %s" % t)
Duration: 4.67 s
Duration: 0.73 s
Felix Steffenhagen (Uni Freiburg)
Using Python for Scientific Computing
2011 5 / 37
................
................
In order to avoid copyright disputes, this page is only a partial summary.
To fulfill the demand for quickly locating and searching documents.
It is intelligent file search solution for home and business.
Related download
- numpy primer cornell university
- guide to numpy mit
- numpy user guide scipy
- using python for scienti c computing
- python numpy cheat sheet intellipaat
- numpy matplotlib troy p kling
- numerical computing in python
- numpy cbse board array
- 1 an introduction to the scienti c python ecosystem
- 3 introduction to numpy brigham young university
Related searches
- using crm for marketing
- using salesforce for project management
- using python in bash
- using python on windows 10
- sum of squared error using python functions
- install jupyter using python 3 8
- using python functions
- using python as a calculator
- using python in cmd
- using python in linux
- using python in command line
- using python with html