xKDR / TSFrames.jl

Timeseries in Julia
MIT License
92 stars 22 forks source link

Empty DataFrame constructor should not output a TSFrame with 1 column #184

Open chiraganand opened 6 months ago

chiraganand commented 6 months ago

The current output is:

 julia> TSFrame(DataFrame([]))
 ERROR: BoundsError: attempt to access 0×0 DataFrame at index [!, 1]
 Stacktrace:
  [1] getindex
    @ ~/.julia/packages/DataFrames/MA4YO/src/dataframe/dataframe.jl:519 [inlined]
  [2] TSFrame(coredata::DataFrame, index::Int64; issorted::Bool, copycols::Bool)
    @ TSFrames ~/projects/TSFrames.jl/src/TSFrame.jl:324
  [3] TSFrame(table::DataFrame; issorted::Bool, copycols::Bool)
    @ TSFrames ~/projects/TSFrames.jl/src/TSFrame.jl:374
  [4] TSFrame(table::DataFrame)
    @ TSFrames ~/projects/TSFrames.jl/src/TSFrame.jl:367
  [5] top-level scope
    @ none:1

But, this should be 0x0 TSFrame with Int64 Index.