I am trying to get a subset of a dataframe. The starting point have to be the first day of the current month. The end point have to be the current day. After that, I want to count the different activities by group.
The dataframe :
date | activity
06-07-2020 | walking
06-07-2020 | rucking
07-07-2020 | tennis
...
I tried that :
DfName[Dates.firstdayofmonth(Dates.today()):Dates.today(), :]
Result :
ERROR: MethodError: Cannot `convert` an object of type Int64 to an object of type Dates.Day
I also tried that :
combine(groupby(DfName, :activity), nrow => :count)
@where(DfName, :date .>= Dates.firstdayofmonth(Dates.today()), :date .<= Dates.today())`
Result :
@where(DfName, :date .>= Dates.firstdayofmonth(Dates.today()), :date .<= Dates.today())
ERROR: MethodError: no method matching isless(::Dates.Date, ::String)
Closest candidates are:
isless(::DataValues.DataValue{Union{}}, ::Any) at /home/...
isless(::PyObject, ::Any) at /home/...
How can I do that in Julia ?