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: non-nano Timestamp methods return wrong results #53668

Closed
3 tasks done
DeaMariaLeon opened this issue Jun 14, 2023 · 1 comment
Closed
3 tasks done

BUG: non-nano Timestamp methods return wrong results #53668

DeaMariaLeon opened this issue Jun 14, 2023 · 1 comment
Assignees
Labels
Bug Timestamp pd.Timestamp and associated methods

Comments

@DeaMariaLeon
Copy link
Member

DeaMariaLeon commented Jun 14, 2023

Pandas version checks

  • 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 main branch of pandas.

Reproducible Example

import pandas as pd
print(pd.__version__)

ts = pd.Timestamp('-2000')

print(f'{ts.date()=}')
print(f'{ts.isocalendar()=}')
print(f'{ts.timetuple()=}')
print(f'{ts.toordinal()=}')


------
ts.date()=datetime.date(1972, 1, 1)
ts.isocalendar()=datetime.IsoCalendarDate(year=1971, week=52, weekday=6)
ts.timetuple()=time.struct_time(tm_year=1972, tm_mon=1, tm_mday=1, tm_hour=0, tm_min=0, tm_sec=0, tm_wday=5, tm_yday=1, tm_isdst=-1)
ts.toordinal()=719893

Issue Description

Wrong dates

Expected Behavior

Should raise 'NotImplementedError'

As reference:
#50793
#53619 - fixed same bug for Timestamp.ctime (while working on docstrings).

Installed Versions

INSTALLED VERSIONS

commit : c65c8dd
python : 3.10.10.final.0
python-bits : 64
OS : Darwin
OS-release : 21.6.0
Version : Darwin Kernel Version 21.6.0: Mon Apr 24 21:10:53 PDT 2023; root:xnu-8020.240.18.701.5~1/RELEASE_X86_64
machine : x86_64
processor : i386
byteorder : little
LC_ALL : None
LANG : None
LOCALE : None.UTF-8

pandas : 2.1.0.dev0+942.gc65c8ddd73.dirty
numpy : 1.24.3
pytz : 2023.3
dateutil : 2.8.2
setuptools : 67.8.0
pip : 23.1.2
Cython : 0.29.33
pytest : 7.3.1
hypothesis : 6.75.3
sphinx : 6.2.1
blosc : 1.11.1
feather : None
xlsxwriter : 3.1.1
lxml.etree : 4.9.2
html5lib : 1.1
pymysql : 1.0.3
psycopg2 : 2.9.6
jinja2 : 3.1.2
IPython : 8.13.2
pandas_datareader: None
bs4 : 4.12.2
bottleneck : 1.3.7
brotli :
fastparquet : 2023.4.0
fsspec : 2023.5.0
gcsfs : 2023.5.0
matplotlib : 3.7.1
numba : 0.57.0
numexpr : 2.8.4
odfpy : None
openpyxl : 3.1.2
pandas_gbq : None
pyarrow : 12.0.0
pyreadstat : 1.2.1
pyxlsb : 1.0.10
s3fs : 2023.5.0
scipy : 1.10.1
snappy :
sqlalchemy : 2.0.15
tables : 3.8.0
tabulate : 0.9.0
xarray : 2023.5.0
xlrd : 2.0.1
zstandard : 0.21.0
tzdata : 2023.3
qtpy : None
pyqt5 : None

@DeaMariaLeon DeaMariaLeon added Bug Needs Triage Issue that has not been reviewed by a pandas team member labels Jun 14, 2023
@DeaMariaLeon
Copy link
Member Author

take

@DeaMariaLeon DeaMariaLeon added Timestamp pd.Timestamp and associated methods and removed Needs Triage Issue that has not been reviewed by a pandas team member labels Jun 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Timestamp pd.Timestamp and associated methods
Projects
None yet
Development

No branches or pull requests

1 participant