QuarterBegin wrong date
See original GitHub issueWould expect this to point to one of (1, 4, 7, 10)…
#### Code Sample, a copy-pastable example if possible
import pandas as pd
pd.Timestamp.today() - pd.tseries.offsets.QuarterBegin()
>Timestamp('2016-09-01 15:29:06.556269')
#### Expected Output
Timestamp('2016-07-01 15:29:06.556269')
#### output of ``pd.show_versions()``
In [4]: pd.show_versions()
INSTALLED VERSIONS
------------------
commit: None
python: 3.5.2.final.0
python-bits: 64
OS: Darwin
OS-release: 15.6.0
machine: x86_64
processor: i386
byteorder: little
LC_ALL: None
LANG: en_US.UTF-8
pandas: 0.18.1
nose: None
pip: 8.1.2
setuptools: 25.1.6
Cython: None
numpy: 1.11.1
scipy: None
statsmodels: None
xarray: None
IPython: 5.1.0
sphinx: None
patsy: None
dateutil: 2.5.3
pytz: 2016.6.1
blosc: None
bottleneck: None
tables: 3.2.3.1
numexpr: 2.6.1
matplotlib: None
openpyxl: None
xlrd: None
xlwt: None
xlsxwriter: None
lxml: None
bs4: None
html5lib: None
httplib2: None
apiclient: None
sqlalchemy: 1.0.13
pymysql: None
psycopg2: 2.6.2 (dt dec pq3 ext lo64)
jinja2: 2.8
boto: None
pandas_datareader: None
Issue Analytics
- State:
- Created 7 years ago
- Comments:16 (11 by maintainers)
Top Results From Across the Web
Pandas QuarterBegin(): Possible Bug when calculating First of ...
import pandas as pd print(" date Quarter Quarter begin Quarter end ") for yr in range(2020, 2021): for mo in range(1,13): for dy...
Read more >Clarification on DateOffset and QuarterBegin, QuarterEnd
Hi,. I thought that the following would give me the quarter start and end date for a particular date. start = mydate -...
Read more >pandas.tseries.offsets.QuarterBegin
DateOffset increments between Quarter start dates. startingMonth = 1 corresponds to dates like 1/01/2007, 4/01/2007, … startingMonth = 2 corresponds to dates ......
Read more >Possible Bug when calculating First of quarter-Pandas,Python
Coding example for the question Pandas QuarterBegin(): Possible Bug when ... import pandas as pd print(" date Quarter Quarter begin Quarter end ")...
Read more >Determining Quarter? - Mibuso Forum
Now I have created two new variables:- QuarterBegin (date) and ... Also, right now it gives me an error that the type of...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
The default anchor month for
QuarterBegin
is 3 (6, 9, 12). It sounds like you want it anchored at 1, if so, use thestartingMonth
keyword arg. Docs could be better here.Those are the defined semantics -
n=1
always rolls forward. http://pandas.pydata.org/pandas-docs/stable/timeseries.html#anchored-offset-semantics