I am new to Mathematica and I would like to select data from a database using dates as criteria. In this moment I am working on the ResourceData["New Orleans Slave Sales 1856-1861"]
from the Wolfram Data Repository. I would like to select from the database only the rows in which the slaves were sold from 1858 till the end.
I already tried with the function Select
and DateRange
mydata = ResourceData["New Orleans Slave Sales 1856-1861"];
Select[mydata,DateRange[DateObject[{1,1,1859}],DateObject[{1,1,1862}]]]
but apparently it does not work, or I am using it wrong. Could someone help me in debugging it or suggest me a better one?
Select
needs to evaluate toTrue
orFalse
; perhaps you could trySelect[mydata,MemberQ[DateRange[DateObject[{1,1,1859}],DateObject[{1,1,1862}]],#]&]
$\endgroup$dates=DateRange[DateObject[{1,1,1859}],DateObject[{1,1,1862}]]; mydata[Select[MemberQ[dates,#"SalesDate"]&]]
? $\endgroup$