Join Michele Vallisneri for an in-depth discussion in this video Records and dates, part of Python: Data Analysis.
- In the last video for this Chapter,…I want to show you two features on NumPy…that are not always covered in tutorials…but are still very useful.…One is Record Arrays,…where every row over two-dimensional array…can have mixed types.…The second is Datetime64 objects,…which has name says,…can encode a date and time.…Let's go to the Python notebook…to try them out and practice.…We will load the exercise file…for Video 04_05.…
We start by importing NumPy…with the np nickname.…Although the very idea of a Numpy Array…is a homogeneous container…of a single well-defined type…it is also possible to create Numpy Arrays with mixed types.…Such a Record Array is a hybrid of a list…and a dictionary.…A list because we can access the rows…using a numerical index.…And a dictionary since we access…the columns by their names by full strings.…
Creating such an array…requires a very specialized index.…We're going to specify the rows…using NumPy two poles.…In this case, each row will contain an integer…a subarray or two floating-point numbers,…
- 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.