AI engineering glossary · NumPy pandas visualization

What is dt accessor?

dt accessor (also called .dt): The .dt namespace on a pandas datetime column that extracts parts such as year, month or weekday, and supports date arithmetic and formatting for every value at once. It is used to create calendar features for analysis and models.

Level: intermediateTopic: NumPy pandas visualization

dt accessor: an example

df['order_date'].dt.month returns the month number of each order.

Related terms

More NumPy pandas visualization terms

Where you learn it

dt accessor is part of the AI Engineering Program, which teaches it with notes, a hands-on lab and an exam. The first lesson is free.

Before you go

Take the cheat sheet with you

One free PDF: the key AI-engineering terms, formulas and Python idioms. No spam; unsubscribe any time.