Hi everyone,
I have a DataFrame with Dates type in one column named “Date” (the rest of the columns are with regular data). I want to filter the dataframe to have data only between years 2015 and 2019.
I tried:
df[@. 2015 <= Dates.year(df.Date) <= 2019, :]
However, I get the following error:
MethodError: no method matching getindex(::DataFrames.DataFrame, ::Tuple{BitVector, Colon})
The data type dump(df.Date)
is:
Array{Dates.Date}((120,))
1: Dates.Date
instant: Dates.UTInstant{Dates.Day}
periods: Dates.Day
value: Int64 735264
...
Any ideas on how to do that efficiently?