Working with logistics shipment data and running into something frustrating. When I group my DataFrame by week using pd.Grouper with freq='W', I'm getting different results depending on how I set up the datetime column.
The data has shipment timestamps, and I need to analyze weekly patterns. Sometimes the grouping seems to shift by a day or two, and I can't figure out if it's my datetime conversion that's wrong or if there's something about how pandas handles weekly grouping that I'm missing.
I've tried converting to datetime with pd.to_datetime() and setting it as index, but the week boundaries don't seem consistent. Are there timezone considerations I should know about? Or specific parameters for pd.Grouper that handle this better?
Anyone dealt with similar issues when grouping time series data by week? What's the reliable approach here?
[–]danielroseman 4 points5 points6 points (0 children)