Chapter 5. Eager and Lazy APIs
Now that you have an understanding of the data structures and data types available in Polars, we look at the two different Application Programming Interfaces (APIs) to interact with that data: the eager API and the lazy API. Each API addresses specific use cases and has unique performance characteristics. Understanding these APIs is critical to using Polars’ data processing and analysis capabilities effectively.
In this chapter, you’ll learn:
-
That the eager API uses an immediate execution model, ideal for data exploration and iterative tasks.
-
That the lazy API defers the execution of data transformations until necessary, which allows comprehensively optimize queries and improving performance, especially in large-scale and performance-sensitive scenarios.
-
About which API fits with which use cases, and how to choose the right one for your needs.
Eager API: DataFrame
The eager API in Polars operates ...
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.