You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In [1]: importpandasaspdIn [2]: pd.Timedelta(0) >pd.Timedelta(None)
TypeError: Cannotcompare type TimedeltawithtypeNaTTypeIn [3]: pd.Timedelta(None) <pd.Timedelta(0)
Out[3]: False
Problem description
I would expect the result of a < b to be the same as that of b > a but in this case one returns False and the other raises TypeError.
Related issue: #24983 "Separate NaT values for Timedelta and Period" - if pd.Timedelta(None) gave a value of type Timedelta then maybe this error would not have occurred.
Expected Output
Either both False or both TypeError (both False would be more helpful)
Code Sample, a copy-pastable example if possible
Problem description
I would expect the result of
a < b
to be the same as that ofb > a
but in this case one returnsFalse
and the other raisesTypeError
.Related issue: #24983 "Separate NaT values for Timedelta and Period" - if
pd.Timedelta(None)
gave a value of typeTimedelta
then maybe this error would not have occurred.Expected Output
Either both
False
or bothTypeError
(bothFalse
would be more helpful)Output of
pd.show_versions()
INSTALLED VERSIONS
commit: None
python: 3.6.8.final.0
python-bits: 64
OS: Linux
OS-release: 4.15.0-46-generic
machine: x86_64
processor: x86_64
byteorder: little
LC_ALL: None
LANG: en_GB.UTF-8
LOCALE: en_GB.UTF-8
pandas: 0.24.2
pytest: 4.3.1
pip: 19.0.3
setuptools: 40.8.0
Cython: 0.29.5
numpy: 1.16.2
scipy: None
pyarrow: None
xarray: 0.11.3
IPython: 7.3.0
sphinx: None
patsy: None
dateutil: 2.6.1
pytz: 2018.9
blosc: None
bottleneck: None
tables: 3.4.4
numexpr: 2.6.9
feather: None
matplotlib: None
openpyxl: None
xlrd: None
xlwt: None
xlsxwriter: None
lxml.etree: None
bs4: None
html5lib: 1.0.1
sqlalchemy: 1.2.18
pymysql: None
psycopg2: 2.7.6.1 (dt dec pq3 ext lo64)
jinja2: 2.10
s3fs: None
fastparquet: None
pandas_gbq: None
pandas_datareader: None
gcsfs: None
The text was updated successfully, but these errors were encountered: