-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
merge_asof(): cannot use tolerance flag when the index is a TimedeltaIndex #27642
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
|
I think adding an elif statement to handle timedeltaIndex then verify tolerance is positive gives the result I desire.
line 1665 merge.py This does give the results I desire, so not unimplemented? also add "is_timedelta64_dtype" to or use |
Still works after I add gaps to my 300Hz data.
|
Right, you can just add the pandas/pandas/core/reshape/merge.py Line 1638 in 0fd888c
PR's welcome! |
* issue #27642 - timedelta merge asof with tolerance
…e asof with tolerance
* issue pandas-dev#27642 - timedelta merge asof with tolerance
Code Sample
Problem description
I need to see NaNs when I merge and there is a gap in my data, without begin able to use the tolerance flag my data gets smoothed.
Current work around, convert all my TimedeltaIndex's to a time stamp. Since I do not have a date for this data I am using unix time. This feels bulky since I am going to drop the date when I save the file anyway.
Expected Output
[301 rows x 1 columns]
my120hz_data my300hz_data
Time
00:00:00 0 0
00:00:00.008333 1 2
00:00:00.016666 2 5
00:00:00.025000 3 7
00:00:00.033333 4 10
... ... ...
00:00:02.466666 296 NaN
00:00:02.475000 297 NaN
00:00:02.483333 298 NaN
00:00:02.491666 299 NaN
00:00:02.500000 300 NaN
Output of
pd.show_versions()
INSTALLED VERSIONS
commit : None
python : 3.7.3.final.0
python-bits : 64
OS : Linux
OS-release : 4.19.0-5-amd64
machine : x86_64
processor :
byteorder : little
LC_ALL : None
LANG : en_US.UTF-8
LOCALE : en_US.UTF-8
pandas : 0.25.0
numpy : 1.17.0
pytz : 2019.1
dateutil : 2.8.0
pip : 18.1
setuptools : 40.8.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 : None
IPython : None
pandas_datareader: None
bs4 : None
bottleneck : None
fastparquet : None
gcsfs : None
lxml.etree : None
matplotlib : None
numexpr : None
odfpy : None
openpyxl : None
pandas_gbq : None
pyarrow : None
pytables : None
s3fs : None
scipy : 1.3.0
sqlalchemy : None
tables : None
xarray : None
xlrd : None
xlwt : None
xlsxwriter : None
The text was updated successfully, but these errors were encountered: