Python lab 3: 2D arrays and plotting - University of York
Python lab 3: 2D arrays and plotting
Dr Ben Dudson
Department of Physics, University of York
11th February 2011
Dr Ben Dudson
Introduction to Programming - Lab 3 (1 of 16)
From last time...
Last time started using NumPy and Matplotlib to create arrays and plot data Arrays could be created using functions like linspace , arange and zeros Once created, arrays can be used much like other variables, so x = x 2 squares every number in an array x Matplotlib can be used to plot data, and even simple animations
This time, we'll look at some more things we can do with arrays and Matplotlib
Dr Ben Dudson
Introduction to Programming - Lab 3 (2 of 16)
Indexing arrays
Last time we used array operations to calculate values for every number (element) in an array:
y = sin (x)
This is an efficient way to do calculations in Python, but sometimes we need to do something more complicated on each element separately.
Dr Ben Dudson
Introduction to Programming - Lab 3 (3 of 16)
Indexing arrays
Last time we used array operations to calculate values for every number (element) in an array:
y = sin (x)
This is an efficient way to do calculations in Python, but sometimes we need to do something more complicated on each element separately. The main reason is if elements in the array depend on each other. If we do an array operation then each number in the array is treated separately. In this case we can use square brackets to refer to individual numbers in the array y [ 0 ] = 10
Dr Ben Dudson
Introduction to Programming - Lab 3 (3 of 16)
Indexing arrays
NumPy is designed to handle large arrays of data efficiently, so to achieve this it tries to minimise copying data. This leads to some quirks which you should watch out for.
Dr Ben Dudson
Introduction to Programming - Lab 3 (4 of 16)
................
................
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
- visualizing data
- 1 lecture 5 numpy and matplotlib
- week 4 university of california berkeley
- plotting and visualization
- python for data science cheat sheet plot anatomy workflow
- python lab 3 2d arrays and plotting university of york
- assignment 1 2d scalar and vector field visualization
- matplotlib tutorialspoint
- optimization with scipy 2
- lab 4 applications plotting with matplotlib
Related searches
- university of new york ranking
- 2d arrays java
- python create empty 2d array
- python initialize empty 2d array
- 3 and 4 digit new york lottery
- using 2d arrays in java
- 2d arrays in javascript
- 2d arrays in python
- lab university of applied sciences
- how do 2d arrays work in c
- university of michigan lab locations
- university of michigan lab sites