I have a pandas dataframe and I am trying to pull the rows that are greater than a date and less than another date. If I run the greater and less than dates separately, it works. If I use the & and try to do both at the same time, I get an error. Any ideas?
Error I am getting is:
TypeError: unsupported operand type(s) for &: 'float' and 'int'
This Works:
df_subset = (df.loc[(df['dump_date'].dt.date >= start)])
This Does Not Work
df_subset = (df.loc[(df['dump_date'].dt.date >= start)]) & (df.loc[(df['dump_date'].dt.date <= end)])