11-04, 11:30–12:00 (Asia/Jerusalem), Blue Track
You probably know how to work with integers, floats, and even strings in Pandas. But Pandas offers a huge amount of functionality having to do with dates and times — much of which, I've found, is unknown even to veteran Pandas users. In this talk, I demonstrate to you what Pandas can do to display, retrieve, sort, group, and format your date-related records.
Everything in Pandas comes down to the dtypes. And while most Pandas users are familiar with a variety of numeric and string dtypes, I've found that they're far less familiar with datetime and timedelta, two dtypes for working with dates and times. Pandas offers a great deal of functionality to work with them — and given how common it is to have date/time columns in our data, knowing how to work with them can be extremely useful.
In this talk, I'll introduce you to the datetime and timedelta dtypes, and particularly how we can read CSV data into Pandas in these forms. We'll see how you can sort and group your data using datetime values, and how you can extract pieces of datetime data with the "dt" accessor. We'll also see how you can create, manipulate, and compare values against "timedelta" values.
Then we'll talk about indexes, and the host of functionality that we get when an index contains datetime values. We'll look at retrieving values with "loc", and also at the "resample" method that offers time-based grouping.
By the end of this talk, you'll have gained practical skills that you can apply to nearly any real-world data set you use.
Reuven is a full-time trainer in Python and data science, teaching companies around the world via in-person, online, and recorded courses. He is the author of both "Python Workout" and "Pandas Workout" (Manning), and writes both "Better Developers" (weekly articles about Python) and "Bamboo Weekly" (weekly Pandas puzzles based on current events). Reuven lives with his wife and children in Modi'in, Israel.