Adding offset to Timestamp discards freq information when freq="M" or "W" #27182
Labels
Datetime
Datetime data dtype
Frequency
DateOffsets
good first issue
Needs Tests
Unit test(s) needed to prevent regressions
Milestone
Code Sample, a copy-pastable example if possible
Problem description
There seem to be a problem when a new
pd.Timestamp
is constructed by adding a multiple of the frequency to an initial timestamp: when the frequency is"M"
or"W"
, then the frequency information is lost in the resulting timestamp.I'm not sure if this is intended behaviour (for some reason), but it seems to be inconsistent across frequencies.
Expected Output
Output of
pd.show_versions()
[paste the output of
pd.show_versions()
here below this line]INSTALLED VERSIONS
commit: None
pandas: 0.24.2
pytest: None
pip: 19.1.1
setuptools: 41.0.1
Cython: None
numpy: 1.16.4
scipy: None
pyarrow: None
xarray: None
IPython: 7.6.0
sphinx: None
patsy: None
dateutil: 2.8.0
pytz: 2019.1
blosc: None
bottleneck: None
tables: None
numexpr: None
feather: None
matplotlib: None
openpyxl: None
xlrd: None
xlwt: None
xlsxwriter: None
lxml.etree: None
bs4: None
html5lib: None
sqlalchemy: None
pymysql: None
psycopg2: None
jinja2: None
s3fs: None
fastparquet: None
pandas_gbq: None
pandas_datareader: None
gcsfs: None
The text was updated successfully, but these errors were encountered: