period

How to set a pandas PeriodIndex with yearly frequency?

How to set a pandas PeriodIndex with yearly frequency? Question: I am able to create quarterly and monthly PeriodIndex like so: idx = pd.PeriodIndex(year=[2000, 2001], quarter=[1,2], freq="Q") # quarterly idx = pd.PeriodIndex(year=[2000, 2001], month=[1,2], freq="M") # monthly I would expect to be able to create a yearly PeriodIndex like so: idx = pd.PeriodIndex(year=[2000, 2001], freq="Y") …

Total answers: 2

Generate a list of datetimes between an interval

Generate a list of datetimes between an interval Question: Given two datetimes (start_date and end_date), I’d like to generate a list of other datetimes between these two dates, the new datetimes being separated by a variable interval. e.g. every 4 days between 2011-10-10 and 2011-12-12 or every 8 hours between now and tomorrow 19p.m. Maybe …

Total answers: 5