What is resampling in Pandas?

Quick Overview

Asks what resampling means for time series data in pandas and how to move a series to a coarser or finer frequency. Tests knowledge of the index requirements, frequency strings, how time buckets are labeled, and the pitfalls of empty buckets and fill methods.

What is resampling in Pandas?

Role: Data Scientist

Category: Data Manipulation (SQL/Python)

Difficulty: easy

Interview Round: Other

What is resampling in Pandas? Explain what `resample()` does to a time series, what the data needs for it to work, and give an example of moving to a coarser and to a finer frequency. ```hint Compare it to groupby `resample()` behaves a lot like `groupby()`. Ask what defines each group, and what happens to a time bucket that contains no rows. ``` ### What a Strong Answer Covers - What resampling does to a time series and what kind of index or column it requires. - How moving to a coarser frequency differs from moving to a finer one, with a short example of each. - How frequency strings define the buckets, and how each bucket is closed and labeled. - Pitfalls in the output, such as empty buckets and fill methods that misrepresent the data. ### Follow-up Questions - How would you compute weekly sales totals per store when the DataFrame has `store_id`, `ts` and `sales` columns? - How is `resample()` different from `rolling()`? - You upsample daily revenue to hourly. Why is a forward fill wrong here, and what would you do instead?

Overview: Asks what resampling means for time series data in pandas and how to move a series to a coarser or finer frequency. Tests knowledge of the index requirements, frequency strings, how time buckets are labeled, and the pitfalls of empty buckets and fill methods.

PracHub logo
General
Nov 25, 2026
easyData ScientistOtherData Manipulation (SQL/Python)
0
0

What is resampling in Pandas? Explain what resample() does to a time series, what the data needs for it to work, and give an example of moving to a coarser and to a finer frequency.

What a Strong Answer Covers Guidance

  • What resampling does to a time series and what kind of index or column it requires.
  • How moving to a coarser frequency differs from moving to a finer one, with a short example of each.
  • How frequency strings define the buckets, and how each bucket is closed and labeled.
  • Pitfalls in the output, such as empty buckets and fill methods that misrepresent the data.

Follow-up Questions Guidance

  • How would you compute weekly sales totals per store when the DataFrame has store_id , ts and sales columns?
  • How is resample() different from rolling() ?
  • You upsample daily revenue to hourly. Why is a forward fill wrong here, and what would you do instead?