-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
BUG: DatetimeIndex has become unhashable in 1.3.1? #42844
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
Comments
Thanks @yohplala for the report
first bad commit: [cd0224d] BUG: Raise ValueError for non numerical join columns in merge_asof (#34488) but looks like the traceback has since changed. was..
cc @phofl |
@yohplala Could you please narrow your example? It should be minimal and reproducible |
@simonjayhawkins I don't think that this is supposed to work. Docs say
while an Index is provided here. |
Hi, yes, will see to that this evening then.
:( (being sad here) It was working with 1.2.5 (the failure happens with test cases of mine that are double-checked: results were correct then) |
Hi Patrick, import pandas as pd
# Right data
ts_right = pd.DatetimeIndex([pd.Timestamp('2021/01/01 00:37'),
pd.Timestamp('2021/01/01 01:40')])
right = pd.DataFrame({'val' : [2,6], 'ts': ts_right}, index=ts_right)
# Left data
ts_left = pd.date_range(start=pd.Timestamp('2021/01/01 00:00'),
periods=3, freq='1h')
left = pd.DataFrame({'val' : [4,8,7], 'timestamp': ts_left})
# Test
merged = pd.merge_asof(left, right, left_on = ts_left, right_index=True,
allow_exact_matches=False, direction='backward') You are right about the root cause ( |
changing milestone to 1.3.5 |
@phofl looks you you worked on this code recently-ish. Is this a usage we should or do support? |
Not sure, I have something in the pipeline to restore but I would be in favor of deprecating for 2.0. we have on tests for passing an array into merge_asof and only two for merge, which were added ages ago |
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.
Hi,
Following code below was working with pandas 1.2.5.
It raises now an error with pandas 1.3.1.
Code Sample, a copy-pastable example
Error message:
Output of
pd.show_versions()
INSTALLED VERSIONS
commit : c7f7443
python : 3.8.8.final.0
python-bits : 64
OS : Linux
OS-release : 5.8.0-63-generic
Version : #71~20.04.1-Ubuntu SMP Thu Jul 15 17:46:08 UTC 2021
machine : x86_64
processor : x86_64
byteorder : little
LC_ALL : None
LANG : en_US.UTF-8
LOCALE : en_US.UTF-8
pandas : 1.3.1
numpy : 1.20.3
pytz : 2021.1
dateutil : 2.8.2
pip : 21.1.3
setuptools : 52.0.0.post20210125
Cython : 0.29.24
pytest : 6.2.4
hypothesis : None
sphinx : 4.0.2
blosc : None
feather : None
xlsxwriter : None
lxml.etree : None
html5lib : None
pymysql : None
psycopg2 : None
jinja2 : 2.11.3
IPython : 7.22.0
pandas_datareader: None
bs4 : 4.9.3
bottleneck : None
fsspec : 2021.07.0
fastparquet : 0.7.0
gcsfs : None
matplotlib : 3.3.4
numexpr : None
odfpy : None
openpyxl : None
pandas_gbq : None
pyarrow : 3.0.0
pyxlsb : None
s3fs : None
scipy : 1.6.2
sqlalchemy : None
tables : None
tabulate : 0.8.9
xarray : 0.19.0
xlrd : None
xlwt : None
numba : 0.53.1
The text was updated successfully, but these errors were encountered: