Chapter 12. Working with Textual, Temporal, and Nested Data Types

In Chapter 4, we covered the basic data types that Polars offers and how they are used to store data in Series. Certain data types deserve special attention because they either have special methods or they are optimized for specific use cases.

These data types can be grouped into textual, temporal, and nested data types. The three textual data types are String, Categorical, Enum, The four temporal data types are Date, Datetime, Time, and Duration. The three nested data types are List, Array, and Struct.

All these data types, except for Enum, have their own namespace. A namespace groups multiple methods into one accessor. For example, the Expr.str namespace has all the methods for String and the Expr.dt namespaces has all the methods for temporal data types.

In this chapter, you’ll learn how to:

  • Create Series with textual, temporal, and nested data types

  • Work with ...

Get Python Polars: The Definitive Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.