I need to filter a stock file for the first 3 years, 2016-2018. My data goes to 2020. I keep getting the same df for all years. This is what I have tried:
df3 = (df2['Date'] > '01-01-2016') & (df2['Date'] <= '31-12-2018')
df3 = (df2['Date'] > '01-01-2016') & (df2['Date'] <= '31-12-2018')
df3 = df2.loc[df3]
df3
It has to be in how I am filtering or the operators, right? I have tried so many variations and either get the same data, or an empty df.