You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
julia>using TSFrames
julia>using MarketData
julia> ts =random_ohlcv() |> TSFrame
500×5 TSFrame with DateTime Index
Index Open High Low Close Volume
DateTime Float64 Float64 Float64 Float64 Float64
──────────────────────────────────────────────────────────────────
2020-01-01T00:00:00826.17832.42825.61829.0281.72020-01-01T01:00:00828.91830.73823.34823.549.82020-01-01T02:00:00823.03825.27819.16822.956.22020-01-01T03:00:00823.38824.78820.55824.7882.52020-01-01T04:00:00825.56829.12824.66829.1242.12020-01-01T05:00:00829.92832.46824.97826.8111.42020-01-01T06:00:00827.07834.45827.07832.5613.02020-01-01T07:00:00833.46834.97830.1832.531.42020-01-01T08:00:00832.06836.01828.83829.4223.12020-01-01T09:00:00829.9831.92829.64831.8339.92020-01-01T10:00:00830.87831.6824.07825.7562.82020-01-01T11:00:00826.61832.88825.93831.281.2⋮⋮⋮⋮⋮⋮2020-01-21T08:00:00707.24707.57701.69703.0942.32020-01-21T09:00:00703.17703.17691.93692.2585.02020-01-21T10:00:00691.94691.94681.72683.0326.52020-01-21T11:00:00683.61683.61671.0671.4527.92020-01-21T12:00:00671.14672.0668.2669.6197.12020-01-21T13:00:00668.99669.6665.31665.8285.32020-01-21T14:00:00665.51670.26665.51668.4427.32020-01-21T15:00:00668.75669.56663.97666.6719.32020-01-21T16:00:00666.39671.97665.61670.8932.82020-01-21T17:00:00670.72670.86667.37667.374.92020-01-21T18:00:00667.18670.17666.05670.1732.12020-01-21T19:00:00669.95677.97669.95673.0428.6476 rows omitted
I would like to get last Volume of this TSFrame (ie here 28.6)
I tried getting last row like this
julia> ts[end, [:Volume]]
ERROR: MethodError: no method matching axes(::TSFrame, ::Int64)
Closest candidates are:axes(::Core.SimpleVector, ::Integer)
@ Base essentials.jl:784axes(::Base.Broadcast.Broadcasted{<:Any, <:Tuple{Vararg{T, N}} where T}, ::Integer) where N
@ Base broadcast.jl:239axes(::DataFrames.GroupKey, ::Integer)
@ DataFrames C:\Users\femto\.julia\packages\DataFrames\58MUJ\src\groupeddataframe\groupeddataframe.jl:653...
Stacktrace:
[1] lastindex(a::TSFrame, d::Int64)
@ Base .\abstractarray.jl:427
[2] top-level scope
@ REPL[81]:1
femtotrader
changed the title
Get last line of a TSFrame and one value of this last line
Get last row of a TSFrame and one value of this last row
Apr 30, 2024
Hello,
I have some sample data like.
I would like to get last Volume of this TSFrame (ie here 28.6)
I tried getting last row like this
that's odd because
works
Isn't there simpler API call (ie directly from TSFrames... not using Dataframes API) than
Kind regards
The text was updated successfully, but these errors were encountered: