i have 2 queries in pandas and need to join them together.
b.loc[b['Speed']=='100.0']
b.loc[b['Month']=='2022-01']
I need to join them using & but getting error of unsupported operand type.
i have 2 queries in pandas and need to join them together.
b.loc[b['Speed']=='100.0']
b.loc[b['Month']=='2022-01']
I need to join them using & but getting error of unsupported operand type.
You are comparing your data having different datatype with comparison value of str
, while it should be float 64 and period M respectively as you have mentioned in your comment.
Try to match your comparison with correct data type. try this:
b.loc[(b['Speed'] == 100.0) & (b['Month'] == pd.Period('2022-01'))]