Join Michele Vallisneri for an in-depth discussion in this video Creating NumPy arrays, part of Introduction to Data Analysis with Python.
- View Offline
- Exercise Files
- We're going to learn how to create NumPy arrays.…This is what we'll learn:…how to create them in several different ways,…how to look at their type or their shape,…how to put several arrays together into a single one,…and how to load and save them.…To do this, once again,…we open the IPython Notebook from the shell…and we go find the exercise files for this chapter.…Since NumPy's a third package,…we need to first import it into Python.…The way to do so is with import numpy.…
And we will specify an abbreviation…since we'd be referring to NumPy a lot in the future.…So we'll import it as np.…While we are doing this,…let's also import matplotlib.pyplot,…which we'll use to plot some of our arrays.…The simplest way to create a NumPy array…is by converting a Python list…and let's look at it immediately.…You'll note that the type of this array,…the dtype or data type,…was guessed by NumPy…based on the content of our list.…
However, we could also specify it.…So, although our list contains integers,…we'd like the type of array to be 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
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?
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.