
This course includes our updated coding exercises so you can practice your skills as you learn.
See a demo
Explore the Polars library in Python for efficient input and output operations, data aggregation, and dataframe manipulation, and gain job-ready skills in data engineering and data analysis.
Learn how to install Python on Windows from python.org, choose the 64-bit installer, enable add to path, and run the interpreter from the terminal before proceeding to Jupyter Lab.
Download and install the Windows stable version of Visual Studio Code from code.visualstudio.com and accept the license. Enable desktop icon, context menu integration, and add VS Code to the path.
Install essential Visual Studio Code extensions, including Microsoft’s Jupiter and Python extensions, to enable IntelliSense and auto suggestions. Verify extensions with the blue checkmark and install PowerShell for scripting.
install polars for python by running pip install polars in a jupyter notebook, verify packages on PyPI before downloading, and confirm the installation completes successfully to use polars dataframes.
Load csv files into Polars dataframes using read_csv, explore default and advanced options such as has_headers, new_columns, separator, types, and try_parse_dates to shape data types.
Export data to CSV using Polars, explaining the tri parse dates argument, default exports, headers options, and custom separators, while importing a call center dataset into a Polars data frame.
Learn to export csv with polars in python by applying date time format codes, using date time and time format arguments, adjusting float precision, and setting null values.
Use Polars write database to transfer data from CSV into SQLite and other databases, creating tables and managing updates with if_exists options: append, replace, or fail.
Read data from a database into a Polars DataFrame using a connection object or a URI, then query the call center table and close the sqlite3 connection.
Install the required package and read Excel files into polars with the read Excel function. Extract data frames from the GL and balances sheets and display numbers, descriptions, and balances.
Convert a pandas data frame to a polars data frame using the from_pandas function after reading a csv, and verify the conversion by printing the top five rows.
Convert a Polars dataframe to a Pandas dataframe using the two Pandas methods, then verify the transformation by inspecting the index and column data types.
Open an ODS file as a polars data frame in Python. Install easy ODF, read sheets with sheet_id, and use schema overrides to convert dates.
Learn to flatten nested json with Polars json normalize, upgrade to 1.0+, handle mixed data with strict=false, and compare results with Pandas while indexing nested structures.
Learn to use lazy frames in polars to scan CSVs, build and optimize a query plan, aggregate by merchant categories, and collect the final data frame.
Learn to load and combine csv files with polars in python using scan csv with file paths, a lazy frame, and collect into a data frame, then export as csv.
Learn how to write a polars data frame with five columns to sql server using pyodbc, creating the credit card transactions table from a 30,000-row csv in seconds.
Explore polars schemas, view with data.schema, and adjust types using schema overrides. Increase inference length to fix misreads, or use a saved schema for faster reads; save schemas as json.
Explore selecting specific columns from a Polars data frame, using built in selectors, by types, keywords, and regular expressions, and learn to include, exclude, or extract single columns.
Learn to filter rows in a polars data frame using single and multi-criteria, such as salary over 70,000 and department IT, to identify relevant employees.
Learn how to slice and sample data in a Polars DataFrame using slice, take_every, and sample with seed for reproducibility.
Learn to query and manipulate data in polars data frames using frame SQL, including selecting, filtering by date ranges, aggregations, and CTEs.
Learn to perform inner joins in polars by merging two dataframes on common keys to produce rows present in both. Use on, left_on, and right_on as needed.
Learn how anti joins in Polars identify differences between two tables by returning rows from the left table not found in the right, illustrated with employees and performance reviews.
Learn how to perform left joins between polars data frames in Python, including on versus left_on and right_on keys, and compare with inner joins to handle missing balances.
Load the employees CSV into a Polars data frame, group by department, use agg with min and max, and inner join to show the employees with min and max salaries.
Apply mean, median, and mode using Polars in Python to describe central tendency. Practice with salary data and department values to explore outliers and mode across numeric and categorical data.
Load employee data from a csv into a polars data frame, view the initial rows, and use sum to compute total salaries and per-department salary expense.
Explore quantiles and quartiles to analyze data distribution in Polars, calculating the 10th percentile of salaries and the main salary quartiles, and compare interpolation options like nearest and midpoint.
Use the business day count function to compute business days between two date columns in underwriting milestone data, such as application date and underwriting submission date.
Learn to use polars add business days to compute two days after an application date, handling weekends with the role function and holidays via the holidays argument and weak mask.
Explore how to handle time zones in Polars with Python zoneinfo, including reading timestamps with time zones, converting between Pacific and Mountain Time, and replacing zones.
Learn to work with Unix timestamps in Polars by converting from epoch to readable dates and back, exploring time units from seconds to nanoseconds within Python data frames.
Learn to extract and compare year components in Polars temporal data with Python, using is leap year, year, ISO year, and week functions, with aliasing.
Master month expressions in polars with native functions and the polars ext plugin for Python to extract months, align to month start and end, and name months in multiple locales.
Discover how Polars uses regular expressions to extract sentiment from unstructured text and apply contains, count matches, and extract to analyze reviews and social media posts including hashtags and mentions.
Learn to convert dates stored as text to temporal types in polars by parsing long-form csv dates, using format codes, stop time expression, and coalesce to unify formats.
Explore hashing sensitive data with polars in python by hashing name and address columns to protect pii, experiment with seeds for reproducibility, and understand seed stacking.
Rank data in Polars using ordinal, dense, and min methods, including window-based ranking by department, to handle ties and present clean top-to-bottom results for salary data.
Learn to classify data with Python data types such as int, float, str, bool, and None, and see how each type affects representation and operations with practical examples.
Explore Python's built-in data structures—lists, tuples, dictionaries, and sets—covering mutability, syntax, and use cases with examples and practical exercises.
Learn how to cast data types in Python using built-in functions, converting strings to integers or floats, and floats to integers, noting Python truncates decimals.
Explore Python's mathematical operators in practice, from addition and subtraction to multiplication, division, floor division, modulus, exponentiation, and string concatenation, with hands-on examples in a Jupyter notebook.
Explore how Python's comparison operators test conditions and direct program flow, covering equal, not equal, greater than, less than, greater than or equal to, and less than or equal to.
Learn to use logical operators in Python to evaluate multiple conditions with and, or, and not. See practical Jupyter notebook examples using booleans, comparisons, ampersand and pipe, and grouped parentheses.
Explore membership operators in Python to test values against lists, tuples, strings, sets, and dictionaries, with practical examples for input validation, file line searches, and dictionary key checks.
Master Python if statements to execute code blocks based on conditions, using if, elif, and else to handle multiple scenarios with practical examples and exercises for functions.
Who Should Take This Course?
Aspiring Data Analysts seeking to learn data discovery practices
Beginner Data Engineers looking to improve data manipulation skills
Data Engineers looking to utilize polars in their data pipelines
Pandas users looking to make the switch to Polars
Why Learn Polars
Over the last decade Python has become more utilized in Data Pipelines. However, most pipelines faced performance issues when processing large datasets in Python. This limitation hindered Python's ability to manage "Big Data".
But in recent years, Polars unlocked the door to processing large datasets with its high performance data structures. It uses parallel processing to quickly read data into DataFrames and Series.
And its performance doesn't stop there! Not only can Polars read and write data quickly, it can also manipulate vast amounts data faster than Pandas.
After Finishing the Course, you'll be able to:
Read CSV files into Polars DataFrames
Know how to push data directly from Polars into a database
Export DataFrames to Excel
Aggregate complex datasets
Join DataFrames together
Utilize Polars' superior processing speed
FAQs
Q: Is the switch from Pandas difficult?
A: No. The basic concepts are the same. There are definitely differences between the two libraries, but functionality between the two are very similar. If you can do it in Pandas, you can do it in Polars!
Q: I'm already learning Pandas, would you say I'm wasting my time?
A: No. My first exposure to DataFrames was using Pandas. Many of the concepts I learned in Pandas helped me understand Polars. They are definitely different in terms of performance. Pandas may at some point release a faster version, but as for now Polars is much faster when working with large datasets.
Q: Pandas has integrations with many more libraries than Polars. Won't I be missing out on these if I make the switch?
A: Absolutely not. Its true that Polars does not have as many integrations with other python libraries, but switching from a polars DataFrame to a Pandas DataFrame is easy. Polars has a function that allows you to convert to and from a Pandas DataFrame. This allows you to get the performance of Polars while also getting the integrations of Pandas. Other libraries have also begun to build integrations with Polars so that may change altogether.
Q: What kind of bear is best?
A: There are basically two schools of thought... Pandas and Polars are indeed competing DataFrame libraries. Its probably for you to decide the answer to this question!