Closed
Description
merge_asof
arguments have to "...be a numeric column, such as datetimelike, integer, or float" but gives cryptic TypeError
instead of ValueError
on bad argument types?
import pandas as pd
left = pd.Series(['2019-06-01 00:09:12', '2019-06-01 00:10:29',
'2019-06-01 00:20:30'], name='time')
right = pd.Series(['2019-06-01 00:01:12', '2019-06-01 00:01:12',
'2019-06-01 00:01:12'], name='time')
pd.merge_asof(left, right)
Output:
...
TypeError: No matching signature found
versus e.g.
import pandas as pd
left = pd.Series(['2019-06-01 00:09:12', '2019-06-01 00:10:29',
'2019-06-01 00:20:30'], name='time')
right = pd.Series(['2019-06-01 00:01:12', '2019-06-01 00:01:12',
'2019-06-01 00:01:12'], name='time')
left = pd.to_datetime(left, infer_datetime_format=True)
right = pd.to_datetime(right, infer_datetime_format=True)
pd.merge_asof(left, right)