Unverified Commit 8d222ab0 authored by Sébastien Villemot's avatar Sébastien Villemot
Browse files

Fix TimeDataFrame(dataframe::AbstractDataFrame, frequency::Frequency,...

Fix TimeDataFrame(dataframe::AbstractDataFrame, frequency::Frequency, firstperiod) constructor when frequency == Undated

The two-argument constructor for Periods() now rejects frequency == Undated.
parent 476b62c3
......@@ -21,7 +21,7 @@ TimeDataFrame(frequency::Frequency) = TimeDataFrame(DataFrame(),
function TimeDataFrame(dataframe::AbstractDataFrame, frequency::Frequency, firstperiod;
copycols::Bool=true)
periods = [Period(firstperiod + i - 1, 0, frequency) for i in 1:DataFrames.nrow(dataframe)]
periods = [Period(firstperiod + i - 1, frequency) for i in 1:DataFrames.nrow(dataframe)]
TimeDataFrame(DataFrame(dataframe; copycols), periods, true, frequency)
end
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment