I have a series in datetime
format, and need to change the day to 1
for each entry. I have thought of numerous simple solutions, but none of them works for me. For now, the only thing that actually works is
- set the series as the index
- Query month and year from the index
- Reconstruct a new time series using year, month and 1
It can't really be that complicated, can it? There is month start, but is unfortunately an offset
, that's of no use here. There seems to be no set()
function for the method, and even less functionality while the series is a column, and not (part of) the index itself.
The only related question was this, but the trick used there is not applicable here.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…