Loading tutorials
DataFrame looks like a spreadsheet, but it is not stored as a grid of cells. It is stored as a set of columns. Each column is an array that holds one kind of value, and all columns share one row index. This model explains most of what you will see later in this tutorial: why a column can 7 min readint, float and str. NumPy experience helps but is not required. By the end you should be able to read a dtype, say how many bytes a column's values take, and predict where numeric types overflow, l7 min readint, float, and str. Familiarity with NumPy arrays helps but is not required. The previous chapter covered NumPy dtypes, where every value has a fixed width and sits in one contiguo7 min readdtype. It also assumes you know that a plain pandas column is backed by a NumPy array, as covered earlier in the tutorial. Here you will learn why a single missing entry can change the type of an entire column. You7 min readfloat64. It also assumes you know that the object dtype stores pointers to Python objects. Those topics come from the earlier chapters. Here you will learn what pandas does when NumPy's dtypes a6 min readobject dtype stores pointers. It also assumes you can build a DataFrame from a dict. Earlier chapters covered all of that. Here you will look one layer down, at how the DataFrame arr6 min readobject dtype is (an array of pointers to Python objects), and the difference between NumPy dtypes and extension dtypes. You should be comfortable reading df.dtypes. Here you learn what pandas reports when you a7 min readobject column is and how to measure memory with `memory_usage(d6 min readdtypes. You should also know that a numeric column is stored as a fixed-width NumPy array, and that memory_usage() reports bytes per column. Both ideas come from earlier chapters.7 min readobject and NumPy dtypes, and how memory_usage(deep=True) works. It also assumes you have used pd.read_csv at a basic level. The examples target pandas 2.x.7 min readobject dtype, missing values, extension dtypes with pd.NA, and memory measurement. You also need pandas 2.0 or later and the pyarrow package installed. Version notes appear where behavior differs.7 min read