-
-
Notifications
You must be signed in to change notification settings - Fork 19.2k
Open
Labels
Description
Code Sample, a copy-pastable example if possible
pd.bdate_range(end='today', periods=2, freq='1A').freq.name
# Prints 'A-DEC'
pd.bdate_range(end='today', periods=2, freq='1A')[0].date()
# prints datetime.date(2015, 12, 31)Problem description
Pandas divides offsets into regular and anchored (see Offset aliases).
There are regular aliases for any frequency but annual. A typical use case - give me a bdate_range with dates spaced 1 year apart ending today. 12M and 52W are only proxies, but won't give the exact expected result.
Expected Output
pd.bdate_range(end='2017-03-12', periods=2, freq='1A-actual-for-real')[0].date() # Saturday
# prints datetime.date(2016, 3, 11) # FridayOutput of pd.show_versions()
pandas: 0.19.2