TypeError: ufunc 'bitwise_and' not supported for the input types, and the inputs could not be safely
Hi hope someone know how to resolve this error.
thanks for reaching out! From the error I believe that the error comes from the order in which operations are performed in Python. & has a higher priority, compared to <=, that's why you get the error. If you add parentheses in the second comparison like so:
df_spx_ftse_H2_08 = df_spx_ftse_00_10[(df_spx_ftse_00_10.new_date >= '2008-07-01') & (df_spx_ftse_00_10.new_date <= '2008-12-31')]
you should be alright.
As an aside, I always put parentheses when I have the & or | operator, just to be sure that everything is running smoothly. You'd be surprised how many potential errors you can avoid that way.
Let me know if that works for you.