Section 9: Introduction to NumPy and SciPy
Section 9: Introduction to NumPy and SciPy
Linxing Preston Jiang
Allen School of Computer Science & Engineering, University of Washington
May 24, 2018
Introduction
Numpy
SciPy
1
Motivation
We have learned all basic data structures...do we need more?
Introduction
Numpy
SciPy
2
A question
You have an matrix like this:
1 2 3 4
4 5 6
7
7 8 9 10
and you want to sum up numbers by each column. How do you write code for it?
Introduction
Numpy
SciPy
3
In Python
a solution using native list
sums = [] for col_idx in range(len(matrix [0])):
sum = 0 for row_idx in range(len(matrix)):
sum += matrix[row_idx][col_idx] sums.append(sum) print sums
Introduction
Numpy
SciPy
4
In Python
a solution if using numpy arrays
print matrix.sum(axis=1)
................
................
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
- section 9 introduction to numpy and scipy
- lists arrays hadronic nuclear physics
- introduction to python data analysis yale university
- numpy array manipulation
- numerical linear algebra
- an introduction to numpy and scipy
- python for data science cheat sheet lists numpy
- numpy arrays
- data structures in python grapenthin
- a quick tour of numpy basics arrays plotting
Related searches
- wyoming section 9 map
- introduction to finance and accounting
- introduction to leadership and management
- introduction to java programming and data structures
- introduction to language and linguistics
- introduction to leadership and governance
- introduction to philosophy and logic
- introduction to positive and negative numbers
- introduction to leadership concepts and practice
- introduction to food and beverage service
- introduction to probability and mathematical statistics pdf
- chapter 9 introduction to waves