High-performance labeled data with xarray
With NumPy, we can manipulate multidimensional numerical data and perform mathematical computations that are highly optimized by low-level C and FORTRAN code. On the other hand, we have seen that pandas allows us to work with labeled, categorical data that resembles data tables using database-like operations.
These two tools complement each other: NumPy does not allow categorical data to be mixed in with numerical values, while pandas is mostly limited to two-dimensional, database-like datasets. Combining these tools can help address many data processing needs, but when we are faced with big, multidimensional data that is also labeled, many performance-related problems arise.
In the last section of this chapter, we will discuss xarray, a library that combines the best of both the NumPy and the pandas worlds and offers one of the best tools for working with labeled multidimensional data. We will explore some of its most prominent features...