Join Michele Vallisneri for an in-depth discussion in this video Indexing and slicing, part of Introduction to Data Analysis with Python.
- In this video, we are going to learn how to index…and slice NumPy arrays.…We will also talk about extensions…to the Python indexing syntax…that are available with NumPy,…and we'll talk about the differences between indexing…and slicing in NumPy and in Python.…Let's go to the Python notebook,…and select the Exercise File for video 04_04.…And again, we'll have to import NumPy.…
The indexing of NumPy arrays is an extension…of what you would do with Python lists.…So for instance, if we build a one dimensional array…of five elements, you could get individual elements…with a bracket notation.…You could start from the end,…and you could try to access a non-existent item…returning an index error.…For a two dimensional array,…such as a five by four area of random numbers,…let me fix this error.…
I do not need to type random what d type it is to use.…It's always double.…The indexing of two dimensional arrays…is obtained with two indices separated by a comma.…The first index refers to the row, the second to the column.…This is different than we would do with Python lists.…
- Writing and running Python in iPython
- Using Python lists and dictionaries
- Creating NumPy arrays
- Indexing and slicing in NumPy
- Downloading and parsing data files into NumPy and Pandas
- Using multilevel series in Pandas
- Aggregating data in Pandas
Skill Level Intermediate
Q: The course shows how to download files from FTP and web servers using Python 3.X. How do I do the same thing with Python 2.7?
A: First import urllib, then use urllib.urlretrieve(URL,filename). For instance, to download the stations.txt files used in the chapter 5 video “Downloading and parsing data files,” you’d do urllib.urlretrieve(‘ftp://ftp.ncdc.noaa.gov/pub/data/ghcn/daily/ghcnd-stations.txt','stations.txt').
1. Installation and Setup
2. Refresher: Data Containers in Python
3. Word Anagrams in Python
4. Introduction to NumPy
5. Weather Data with NumPy
6. Introduction to Pandas
7. Baby Names with Pandas
Next steps1m 36s
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.