Implementation in Julia
TimeSeries is a registered package. So like other packages, we can add it to your Julia packages:
Pkg.update()
Pkg.add("TimeSeries")
The TimeArray time series type
immutable TimeArray{T, N, D<:TimeType, A<:AbstractArray} <: AbstractTimeSeries timestamp::Vector{D} values::A colnames::Vector{UTF8String} meta::Any function TimeArray(timestamp::Vector{D}, values::AbstractArray{T,N}, colnames::Vector{UTF8String}, meta::Any) nrow, ncol = size(values, 1), size(values, 2) nrow != size(timestamp, 1) ? error("values must match length of timestamp"): ncol != size(colnames,1) ? error("column names must match width of array"): timestamp != unique(timestamp) ? error("there are duplicate dates"): ~(flipdim(timestamp, 1) == sort(timestamp) ...
Get Julia for Data Science now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.