What are frequency strings and offset aliases in pandas time series, and how are they used?

Quick Overview

Asks what pandas frequency strings and offset aliases are and where they are used in time series work. Tests knowledge of common aliases, multipliers and anchors, the DateOffset objects behind them, and the difference between date_range, resample and asfreq.

What are frequency strings and offset aliases in pandas time series, and how are they used?

Role: Data Scientist

Category: Data Manipulation (SQL/Python)

Difficulty: medium

Interview Round: Other

What are frequency strings and offset aliases in pandas time series, and how are they used? ```hint Where pandas needs a time step List the time series operations that need to know a spacing or a bucket size, and think about what a short string would have to encode for each of them. ``` ### What a Strong Answer Covers - What a frequency string encodes and how it maps to `DateOffset` objects - Common aliases, numeric multipliers and anchored suffixes - The functions that accept them, and how resampling differs from changing frequency - Calendar-aware offsets compared with fixed-length ones, and the alias changes between pandas versions ### Follow-up Questions - What is the difference between `resample("W").sum()` and `asfreq("W")` on a daily series? - How would you bucket timestamps into weeks that start on Monday and are labeled by that Monday? - Why can `"30D"` and `"ME"` produce different bucket boundaries, and when does that matter?

Overview: Asks what pandas frequency strings and offset aliases are and where they are used in time series work. Tests knowledge of common aliases, multipliers and anchors, the DateOffset objects behind them, and the difference between date_range, resample and asfreq.

General logo
General
Nov 24, 2026
mediumData ScientistOtherData Manipulation (SQL/Python)
0
0

What are frequency strings and offset aliases in pandas time series, and how are they used?

What a Strong Answer Covers Guidance

  • What a frequency string encodes and how it maps to DateOffset objects
  • Common aliases, numeric multipliers and anchored suffixes
  • The functions that accept them, and how resampling differs from changing frequency
  • Calendar-aware offsets compared with fixed-length ones, and the alias changes between pandas versions

Follow-up Questions Guidance

  • What is the difference between resample("W").sum() and asfreq("W") on a daily series?
  • How would you bucket timestamps into weeks that start on Monday and are labeled by that Monday?
  • Why can "30D" and "ME" produce different bucket boundaries, and when does that matter?