Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUG: nanosecond & nanoseconds parameters of DateOffset object do not affects #44560

Closed
3 tasks done
idanhazan opened this issue Nov 21, 2021 · 1 comment
Closed
3 tasks done
Labels
Duplicate Report Duplicate issue or pull request Frequency DateOffsets

Comments

@idanhazan
Copy link

idanhazan commented Nov 21, 2021

  • I have checked that this issue has not already been reported.

  • I have confirmed this bug exists on the latest version of pandas.

  • I have confirmed this bug exists on the master branch of pandas.

Reproducible Example

import pandas as pd

timestamp = pd.Timestamp('2020-11-21 10:20:30.123456789')

dateoffset = pd.DateOffset(nanosecond=100)
print(timestamp + dateoffset)  # Timestamp('2020-11-22 10:20:30.123456789')

dateoffset = pd.DateOffset(nanoseconds=100)
print(timestamp + dateoffset)  # Timestamp('2020-11-22 10:20:30.123456789')

dateoffset = pd.DateOffset(nanosecond=100, nanoseconds=100)
print(timestamp + dateoffset)  # Timestamp('2020-11-22 10:20:30.123456789')

Issue Description

Both of 'nanosecond' & 'nanoseconds' parameters of DateOffset object do not affects, Please take a look of the examples.

Expected Behavior

import pandas as pd

timestamp = pd.Timestamp('2020-11-21 10:20:30.123456789')

dateoffset = pd.DateOffset(nanosecond=100)
print(timestamp + dateoffset) # Timestamp('2020-11-22 10:20:30.123456100')

dateoffset = pd.DateOffset(nanoseconds=100)
print(timestamp + dateoffset) # Timestamp('2020-11-22 10:20:30.123456889')

dateoffset = pd.DateOffset(nanosecond=100, nanoseconds=100)
print(timestamp + dateoffset) # Timestamp('2020-11-22 10:20:30.123456200')

Installed Versions

INSTALLED VERSIONS

commit : 945c9ed
python : 3.9.7.final.0
python-bits : 64
OS : Linux
OS-release : 5.13.0-21-generic
Version : #21-Ubuntu SMP Tue Oct 19 08:59:28 UTC 2021
machine : x86_64
processor : x86_64
byteorder : little
LC_ALL : None
LANG : en_IL
LOCALE : en_IL.UTF-8

pandas : 1.3.4
numpy : 1.21.2
pytz : 2021.3
dateutil : 2.8.2
pip : 21.2.4
setuptools : 58.0.4
Cython : None
pytest : None
hypothesis : None
sphinx : 4.2.0
blosc : None
feather : None
xlsxwriter : None
lxml.etree : 4.6.3
html5lib : None
pymysql : None
psycopg2 : 2.8.6 (dt dec pq3 ext lo64)
jinja2 : 3.0.2
IPython : 7.29.0
pandas_datareader: None
bs4 : None
bottleneck : 1.3.2
fsspec : 2021.10.1
fastparquet : None
gcsfs : None
matplotlib : 3.4.3
numexpr : 2.7.3
odfpy : None
openpyxl : None
pandas_gbq : None
pyarrow : None
pyxlsb : None
s3fs : None
scipy : 1.7.1
sqlalchemy : 1.4.22
tables : None
tabulate : None
xarray : None
xlrd : None
xlwt : None
numba : None

@idanhazan idanhazan added Bug Needs Triage Issue that has not been reviewed by a pandas team member labels Nov 21, 2021
@idanhazan idanhazan changed the title BUG: nanoseconds & nanoseconds parameters of DateOffset object do not affects BUG: nanosecond & nanoseconds parameters of DateOffset object do not affects Nov 21, 2021
@jreback
Copy link
Contributor

jreback commented Nov 21, 2021

duplicate of #43892 and it has a PR in progress to fix

@jreback jreback added Frequency DateOffsets duplicated duplicated, drop_duplicates and removed Bug Needs Triage Issue that has not been reviewed by a pandas team member labels Nov 21, 2021
@jreback jreback added this to the No action milestone Nov 21, 2021
@jreback jreback closed this as completed Nov 21, 2021
@jreback jreback added Duplicate Report Duplicate issue or pull request and removed duplicated duplicated, drop_duplicates labels Nov 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Duplicate Report Duplicate issue or pull request Frequency DateOffsets
Projects
None yet
Development

No branches or pull requests

2 participants