Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Snap drops name from datetimeindex #25575
Code Sample, a copy-pastable example if possible
import pandas as pd dti = pd.DatetimeIndex(, name='my_dti', freq='H') print(dti.round('D')) # Name is preserved print(dti.snap('D')) # Name is lost
The DatetimeIndex.snap method loses the name of the DatetimeIndex which is a different behaviour than DatetimeIndex.round (or floor, ceil, etc.) that preserves the name of the DatetimeIndex.
DatetimeIndex(, dtype='datetime64[ns]', name='my_dti', freq='D')
I'm not exactly sure how snap is supposed to work or what differentiates it from round. Don't think I've seen a single working example showing how snap is intended to be used. Does anyone know what it's supposed to do beyond the one sentence description in the docstring?
I have been poking around through trial and error. The best that I can come up with is that:
I came across