In the previous lesson, we learned how to work with CSV data using NumPy. In this lesson, we'll learn about datatypes in NumPy.

In particular, you'll:

  • Learn what datatypes are available in NumPy.
  • Learn about ndarrays' limitations of holding only one type of data.
  • How to set the datatype of an ndarray.
  • How to evaluate the memory consumption of an ndarray.
  • Learn about the limitations of fixed-bit length number representations.

As with all Dataquest lessons, this is an interactive learning experience. You'll be writing real Python code and using NumPy in our browser-based coding environment so there's no setup and no obstacles between you and learning!

Objectives

  • Learn more about the limitations of NumPy
  • Learn to measure the memory consumption of ndarrays

Lesson Outline

  1. Introduction
  2. Fixed NumPy Datatypes
  3. Finding the Datatype
  4. Ndarray from Mixed Lists
  5. Fixed-Length Bit Representations
  6. Memory Consumption
  7. Arithmetic Overflow
  8. Float Limitations
  9. Calculating Memory Requirements
  10. Next Steps