-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
BUG: Inconsistent initialization of timedelta64
between Series vs numpy & pd.TimeDelta
#35465
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
Closed
2 of 3 tasks
Labels
good first issue
Needs Tests
Unit test(s) needed to prevent regressions
Timedelta
Timedelta data type
Comments
Thanks @galipremsagar for the report. Further investigation and PRs welcome. |
I'll mark as a regression as this raised Exception in 0.25.3
|
So is the expected behavior to raise an exception or initialization similar to numpy? |
I think the recent non-nano support probably fixed the Series initialization case with
|
3 tasks
mroeschke
pushed a commit
that referenced
this issue
Jul 27, 2022
* TST GH35465 Tests for repr of Series with dtype timedelta64 * pre commit test file * TST GH35465 Tests for Series constructs with dtype timedelta64 * restore pandas/tests/series/test_repr.py * perform pre-commit * use int64 for tests
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
good first issue
Needs Tests
Unit test(s) needed to prevent regressions
Timedelta
Timedelta data type
I have checked that this issue has not already been reported.
I have confirmed this bug exists on the latest version of pandas.
(optional) I have confirmed this bug exists on the master branch of pandas.
Note: Please read this guide detailing how to provide the necessary information for us to reproduce your bug.
The creation of a pandas Series with any dtype other than
timedelta64[ns]
is discarding values and setting the entire series to0
's. Whereasnumpy.array
andpd.TimeDelta
are correctly instantiating and preserving the passed values which can be retrieved by a type-cast too.Code Sample, a copy-pastable example
Problem description
The expected behaviour is Series initialization must be in-line with numpy array initialization in this case.
Expected Output
Output of
pd.show_versions()
INSTALLED VERSIONS
commit : d9fff27
python : 3.7.3.final.0
python-bits : 64
OS : Darwin
OS-release : 19.6.0
Version : Darwin Kernel Version 19.6.0: Sun Jul 5 00:43:10 PDT 2020; root:xnu-6153.141.1~9/RELEASE_X86_64
machine : x86_64
processor : i386
byteorder : little
LC_ALL : None
LANG : None
LOCALE : en_US.UTF-8
pandas : 1.1.0
numpy : 1.19.0
pytz : 2020.1
dateutil : 2.8.1
pip : 20.1.1
setuptools : 49.1.0
Cython : None
pytest : None
hypothesis : None
sphinx : None
blosc : None
feather : None
xlsxwriter : None
lxml.etree : None
html5lib : None
pymysql : None
psycopg2 : None
jinja2 : 2.11.2
IPython : None
pandas_datareader: None
bs4 : None
bottleneck : None
fsspec : None
fastparquet : None
gcsfs : None
matplotlib : None
numexpr : None
odfpy : None
openpyxl : None
pandas_gbq : None
pyarrow : None
pytables : None
pyxlsb : None
s3fs : None
scipy : None
sqlalchemy : None
tables : None
tabulate : None
xarray : None
xlrd : None
xlwt : None
numba : None
The text was updated successfully, but these errors were encountered: