using Dates
dateReported = map((x) -> string(x), df[:DateReported])
df[:DateOccurred] = map((x) -> if
match(r"^((19|20)\d\d)(0[1-9]|1[012])(0[1-9]|[12][0-9]|3[01])", x)!=nothing
Date(x, DateFormat("yyyymmdd")) end, dateOccurred)
I am trying to change type of a dataframe column to Date from Int64.
The last statement returns an error
Date not defined
while loading In[18], in expression starting on line 1
in anonymous at In[18]:1
in map at /Users/ajkale/.julia/v0.3/DataArrays/src/datavector.jl:117
I am trying this in the ipython julia notebook. This works fine in the REPL
though.
Asked this on stackoverflow as
well
http://stackoverflow.com/questions/27094669/date-not-working-in-ipython-notebook-but-works-on-julia-repl/27112355#27112355