Skip to content Skip to sidebar Skip to footer

Python Pandas Pd.merge_asof: Typeerror: 'nonetype' Object Is Not Callable

I just discovered pandas merge_asof function and trying to get it to work. Below is some sample code that reproduces the error I am seeing: d1 = pd.DataFrame.from_dict({'id':[64632

Solution 1:

I was able to solve this problem by casting id to an int.

d1['id'] = d1['id'].astype('int')
d2['id'] = d2['id'].astype('int')
d3 = pd.merge_asof(d1, d2, by = 'id', on = 'units', direction='nearest')

Post a Comment for "Python Pandas Pd.merge_asof: Typeerror: 'nonetype' Object Is Not Callable"