# Announcing TSFrames.jl (formerly TSx) v0.1.0: A timeseries data manipulation package based on DataFrames

**URL:** https://discourse.julialang.org/t/announcing-tsframes-jl-formerly-tsx-v0-1-0-a-timeseries-data-manipulation-package-based-on-dataframes/91264
**Category:** Package Announcements
**Tags:** package, dataframes, time-series
**Created:** [December 5, 2022, 2:23pm UTC](https://discourse.julialang.org/t/announcing-tsframes-jl-formerly-tsx-v0-1-0-a-timeseries-data-manipulation-package-based-on-dataframes/91264 "2022-12-05T14:23:12Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![chiraganand](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chiraganand/32/32787_2.png) [@chiraganand](https://discourse.julialang.org/u/chiraganand)
#### Post date: [December 5, 2022, 2:23pm UTC](https://discourse.julialang.org/t/announcing-tsframes-jl-formerly-tsx-v0-1-0-a-timeseries-data-manipulation-package-based-on-dataframes/91264/1 "2022-12-05T14:23:12Z")

</div>

TSFrames provides a convenient interface for performing standard manipulations of timeseries data. The package uses DataFrame at it’s core to allow powerful data manipulation functions while being lightweight. A lot of functionality/interfaces are inspired by the _zoo_ and _xts_ packages in the R ecosystem.

TSFrames.jl is registered in the general Julia repository, hence, can be added using `Pkg.add("TSFrames")`.

Repository URL: [GitHub - xKDR/TSFrames.jl: Timeseries in Julia](https://github.com/xKDR/TSFrames.jl)  
Link to the documentation: [Introduction · TSFrames.jl](https://xkdr.github.io/TSFrames.jl/dev/)

---

<div class="post-metadata">

### Author: ![bkamins](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/bkamins/32/208538_2.png) [@bkamins](https://discourse.julialang.org/u/bkamins)
#### Post date: [December 5, 2022, 2:29pm UTC](https://discourse.julialang.org/t/announcing-tsframes-jl-formerly-tsx-v0-1-0-a-timeseries-data-manipulation-package-based-on-dataframes/91264/2 "2022-12-05T14:29:06Z")

</div>

Are you planning to use metadata to track `Index` in the future?

---

<div class="post-metadata">

### Author: ![chiraganand](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chiraganand/32/32787_2.png) [@chiraganand](https://discourse.julialang.org/u/chiraganand)
#### Post date: [December 5, 2022, 2:46pm UTC](https://discourse.julialang.org/t/announcing-tsframes-jl-formerly-tsx-v0-1-0-a-timeseries-data-manipulation-package-based-on-dataframes/91264/3 "2022-12-05T14:46:51Z")

</div>

> Are you planning to use metadata to track `Index` in the future?

Planning to use the DataFrames metadata for storing various table-level information like data source, year, and other such information.

---

<div class="post-metadata">

### Author: ![juliohm](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/juliohm/32/215266_2.png) [@juliohm](https://discourse.julialang.org/u/juliohm)
#### Post date: [December 5, 2022, 3:09pm UTC](https://discourse.julialang.org/t/announcing-tsframes-jl-formerly-tsx-v0-1-0-a-timeseries-data-manipulation-package-based-on-dataframes/91264/4 "2022-12-05T15:09:36Z")

</div>

Worth adding a comparison with tons of other packages already available for time series in Julia.

---

<div class="post-metadata">

### Author: ![chiraganand](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chiraganand/32/32787_2.png) [@chiraganand](https://discourse.julialang.org/u/chiraganand)
#### Post date: [December 5, 2022, 5:15pm UTC](https://discourse.julialang.org/t/announcing-tsframes-jl-formerly-tsx-v0-1-0-a-timeseries-data-manipulation-package-based-on-dataframes/91264/5 "2022-12-05T17:15:37Z")

</div>

Some of the design principles which were followed while building this package:

1. Handling of **heterogeneous data types:** most existing packages handles one type in the core data structure.
2. **Easy maintenance:** some main timeseries related packages are currently unmaintained.
3. **Avoiding duplication of coding effort** by using the core data structure of an existing widely used and well-tested package (DataFrames.jl).
4. **Convenient syntax:** most of the timeseries related data operations can be done using DataFrames but the syntax it isn’t really convenient or intuitive for such operations. The TSFrames interfaces are convenient for doing timeseries specific operations but under the hood most of them use DataFrames operations.

---

<div class="post-metadata">

### Author: ![mdogan](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mdogan/32/47244_2.png) [@mdogan](https://discourse.julialang.org/u/mdogan)
#### Post date: [February 6, 2023, 10:23pm UTC](https://discourse.julialang.org/t/announcing-tsframes-jl-formerly-tsx-v0-1-0-a-timeseries-data-manipulation-package-based-on-dataframes/91264/6 "2023-02-06T22:23:14Z")

</div>

I am currently developing a finance related library and it is significantly dependent on TSFrames.jl as it looks to me that it is the only maintained time series data library.

I am just wondering if you will be maintaining this library in the future?

Thank you.

---

<div class="post-metadata">

### Author: ![chiraganand](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chiraganand/32/32787_2.png) [@chiraganand](https://discourse.julialang.org/u/chiraganand)
#### Post date: [February 7, 2023, 8:29am UTC](https://discourse.julialang.org/t/announcing-tsframes-jl-formerly-tsx-v0-1-0-a-timeseries-data-manipulation-package-based-on-dataframes/91264/7 "2023-02-07T08:29:48Z")

</div>

Can you send the link to your library? We ([XKDR Forum](https://github.com/xKDR/)) have also started work on some other finance-related packages which depend on TSFrames.jl. It would be good to know what each of us are doing to avoid overlap and collaborate, if possible.

Yes, we do plan to maintain the package going forward.

---

<div class="post-metadata">

### Author: ![mdogan](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mdogan/32/47244_2.png) [@mdogan](https://discourse.julialang.org/u/mdogan)
#### Post date: [February 7, 2023, 10:12am UTC](https://discourse.julialang.org/t/announcing-tsframes-jl-formerly-tsx-v0-1-0-a-timeseries-data-manipulation-package-based-on-dataframes/91264/8 "2023-02-07T10:12:52Z")

</div>

Thanks very much for the answer. To be honest too early to share something. There are only a few functions at this moment but will grow over time.

It will start with very basic functions like simple returns, then will be portfolio returns, and risk metrices etc.

Whereever possible TSFrames functions will be used within functions to avoid unnecessary duplication and where not possible will be writing custom ones.

Regards

---

<div class="post-metadata">

### Author: ![viralbshah](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/viralbshah/32/54_2.png) [@viralbshah](https://discourse.julialang.org/u/viralbshah)
#### Post date: [February 8, 2023, 11:33pm UTC](https://discourse.julialang.org/t/announcing-tsframes-jl-formerly-tsx-v0-1-0-a-timeseries-data-manipulation-package-based-on-dataframes/91264/9 "2023-02-08T23:33:31Z")

</div>

Do you know if OnlineStats.jl will “just work” with TSFrames?

> **[GitHub - joshday/OnlineStats.jl: ⚡ Single-pass algorithms for statistics](https://github.com/joshday/OnlineStats.jl)**
>
> ⚡ Single-pass algorithms for statistics. Contribute to joshday/OnlineStats.jl development by creating an account on GitHub.

-viral

---

<div class="post-metadata">

### Author: ![chiraganand](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chiraganand/32/32787_2.png) [@chiraganand](https://discourse.julialang.org/u/chiraganand)
#### Post date: [February 9, 2023, 5:34am UTC](https://discourse.julialang.org/t/announcing-tsframes-jl-formerly-tsx-v0-1-0-a-timeseries-data-manipulation-package-based-on-dataframes/91264/10 "2023-02-09T05:34:36Z")

</div>

> [@viralbshah](#):
>
> Do you know if OnlineStats.jl will “just work” with TSFrames?

Just checked OnlineStats. Some of the methods which accept an array or `<:Number` as input just work by subsetting a TSFrame. Some others like `Lag()` which accept custom type are also able to store last `N` values of type `TSFrame`.

---

<div class="post-metadata">

### Author: ![mdogan](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mdogan/32/47244_2.png) [@mdogan](https://discourse.julialang.org/u/mdogan)
#### Post date: [February 9, 2023, 11:20am UTC](https://discourse.julialang.org/t/announcing-tsframes-jl-formerly-tsx-v0-1-0-a-timeseries-data-manipulation-package-based-on-dataframes/91264/11 "2023-02-09T11:20:36Z")

</div>

Hi @chiraganand,

I was wondering if there is any way to calculate the percentiles of the TSFrame object.

```julia
using TSFrames
using Statistics

bond = [0.06276629, 0.03958098, 0.08456482,0.02759821,0.09584956,0.06363253,0.02874502,0.02707264,0.08776449,0.02950032]
stock = [0.1759782,0.20386651,0.21993588,0.3090001,0.17365969,0.10465274,0.07888138,0.13220847,0.28409742,0.14343067]

ts = TSFrame([bond stock])

```

I am looking for something like:

```julia
quantile(ts, 0.10)

```

to calculate the quantiles of column(s).

---

<div class="post-metadata">

### Author: ![chiraganand](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chiraganand/32/32787_2.png) [@chiraganand](https://discourse.julialang.org/u/chiraganand)
#### Post date: [February 10, 2023, 7:40am UTC](https://discourse.julialang.org/t/announcing-tsframes-jl-formerly-tsx-v0-1-0-a-timeseries-data-manipulation-package-based-on-dataframes/91264/12 "2023-02-10T07:40:45Z")

</div>

> [@mdogan](#):
>
> I am looking for something like:
> 
> ```julia
> quantile(ts, 0.10)
> 
> ```
> 
> to calculate the quantiles of column(s).

There is no method currently which dispatches on `quantile()` in TSFrames but you can use Tables.jl `columns` interface to iterate over columns:

```julia
Import Tables

q = []
for col in Tables.columns
    push!(q, quantile(col, 0.10))
end

```

---

<div class="post-metadata">

### Author: ![mdogan](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mdogan/32/47244_2.png) [@mdogan](https://discourse.julialang.org/u/mdogan)
#### Post date: [February 12, 2023, 5:50pm UTC](https://discourse.julialang.org/t/announcing-tsframes-jl-formerly-tsx-v0-1-0-a-timeseries-data-manipulation-package-based-on-dataframes/91264/13 "2023-02-12T17:50:31Z")

</div>

Thank you for your answer. One another question, please:

```julia
skipmissing(ts)

```

skipmissing is not working, and I cannot remove the missing values from a TSFrame object. I checked the documentation but could not find a function to remove NAs or missing values.

Is there any way to do that?

Thank you

---

<div class="post-metadata">

### Author: ![jar1](https://avatars.discourse-cdn.com/v4/letter/j/c0e974/32.png) [@jar1](https://discourse.julialang.org/u/jar1)
#### Post date: [February 12, 2023, 8:05pm UTC](https://discourse.julialang.org/t/announcing-tsframes-jl-formerly-tsx-v0-1-0-a-timeseries-data-manipulation-package-based-on-dataframes/91264/14 "2023-02-12T20:05:44Z")

</div>

You might be looking for `dropmissing` .

---

<div class="post-metadata">

### Author: ![chiraganand](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chiraganand/32/32787_2.png) [@chiraganand](https://discourse.julialang.org/u/chiraganand)
#### Post date: [February 13, 2023, 12:03pm UTC](https://discourse.julialang.org/t/announcing-tsframes-jl-formerly-tsx-v0-1-0-a-timeseries-data-manipulation-package-based-on-dataframes/91264/15 "2023-02-13T12:03:05Z")

</div>

> [@mdogan](#):
>
> skipmissing is not working, and I cannot remove the missing values from a TSFrame object. I checked the documentation but could not find a function to remove NAs or missing values.

Which version are you on? I am doing this on v0.2.0:

```julia
julia> skipmissing(TSFrame(1:10))
skipmissing(10×1 TSFrame with Int64 Index
 Index x1    
 Int64 Int64 
──────────────
     1 1
     2 2
     3 3
     4 4
     5 5
     6 6
     7 7
     8 8
     9 9
    10 10)

```

---

<div class="post-metadata">

### Author: ![mdogan](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mdogan/32/47244_2.png) [@mdogan](https://discourse.julialang.org/u/mdogan)
#### Post date: [February 13, 2023, 5:58pm UTC](https://discourse.julialang.org/t/announcing-tsframes-jl-formerly-tsx-v0-1-0-a-timeseries-data-manipulation-package-based-on-dataframes/91264/16 "2023-02-13T17:58:12Z")

</div>

Thanks very much for your reply. I see that this also works for me. Just that I was using it with another function, that’s why it has thrown an error.

---

<div class="post-metadata">

### Author: ![mdogan](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mdogan/32/47244_2.png) [@mdogan](https://discourse.julialang.org/u/mdogan)
#### Post date: [February 14, 2023, 10:40am UTC](https://discourse.julialang.org/t/announcing-tsframes-jl-formerly-tsx-v0-1-0-a-timeseries-data-manipulation-package-based-on-dataframes/91264/17 "2023-02-14T10:40:11Z")

</div>

My apologies for coming back on this again. Is there any way I can **drop rows** contain `missing`

Unfortunately, so many functions in Julia do not accept `skipmissing(TSFrame(1:10))`, and it throws a lot of errors because of it.

Thank you

---

<div class="post-metadata">

### Author: ![mdogan](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mdogan/32/47244_2.png) [@mdogan](https://discourse.julialang.org/u/mdogan)
#### Post date: [February 14, 2023, 8:51pm UTC](https://discourse.julialang.org/t/announcing-tsframes-jl-formerly-tsx-v0-1-0-a-timeseries-data-manipulation-package-based-on-dataframes/91264/18 "2023-02-14T20:51:02Z")

</div>

Thanks for your reply @jar1, `dropmissing` does not work with TSFrame object.

---

<div class="post-metadata">

### Author: ![pdeffebach](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pdeffebach/32/10320_2.png) [@pdeffebach](https://discourse.julialang.org/u/pdeffebach)
#### Post date: [February 14, 2023, 9:00pm UTC](https://discourse.julialang.org/t/announcing-tsframes-jl-formerly-tsx-v0-1-0-a-timeseries-data-manipulation-package-based-on-dataframes/91264/19 "2023-02-14T21:00:01Z")

</div>

`skipmissing` is for iterators directly, not a data frame-like object which do not iterate values themselves.

---

<div class="post-metadata">

### Author: ![jar1](https://avatars.discourse-cdn.com/v4/letter/j/c0e974/32.png) [@jar1](https://discourse.julialang.org/u/jar1)
#### Post date: [February 14, 2023, 9:15pm UTC](https://discourse.julialang.org/t/announcing-tsframes-jl-formerly-tsx-v0-1-0-a-timeseries-data-manipulation-package-based-on-dataframes/91264/20 "2023-02-14T21:15:52Z")

</div>

@bkamins Should `dropmissing` be generic in DataAPI? TSFrames is implementing `skipmissing`; I’m not sure that’s the right way to go.

[Next page](https://discourse.julialang.org/t/announcing-tsframes-jl-formerly-tsx-v0-1-0-a-timeseries-data-manipulation-package-based-on-dataframes/91264.md?page=2)
