# TimeSeries.jl and upsampling

**URL:** <https://discourse.julialang.org/t/timeseries-jl-and-upsampling/88896>\
**Category:** Data\
**Created:** [October 18, 2022, 9:05am UTC](https://discourse.julialang.org/t/timeseries-jl-and-upsampling/88896 "2022-10-18T09:05:42Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![olivier](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/olivier/32/43648_2.png) [@olivier](https://discourse.julialang.org/u/olivier)\
**Post date:** [October 18, 2022, 9:05am UTC](https://discourse.julialang.org/t/timeseries-jl-and-upsampling/88896/1 "2022-10-18T09:05:42Z")

</div>

Hi,

I need to be able to resample time series both ways : downsampling and upsimpling.  
I was able to downsample my time series using both TimeSeries.jl and TimeSeriesResampler.jl  
But the later doesn’t support upsampling (mostly using nearest or left or right or linear interpolation).

Has anybody found a solution to that ? Maybe there is a better package for that ?  
Any idea ?

Thank you for your help.

---

<div class="post-metadata">

**Author:** ![simsurace](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/simsurace/32/30216_2.png) [@simsurace](https://discourse.julialang.org/u/simsurace)\
**Post date:** [October 18, 2022, 11:58am UTC](https://discourse.julialang.org/t/timeseries-jl-and-upsampling/88896/2 "2022-10-18T11:58:13Z")

</div>

Maybe [Interpolations.jl](https://juliamath.github.io/Interpolations.jl/stable/) is useful for your use case, but I haven’t checked whether it composes with Timeseries.jl.

---

<div class="post-metadata">

**Author:** ![Jake](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jake/32/46007_2.png) [@Jake](https://discourse.julialang.org/u/Jake)\
**Post date:** [October 18, 2022, 12:21pm UTC](https://discourse.julialang.org/t/timeseries-jl-and-upsampling/88896/3 "2022-10-18T12:21:29Z")

</div>

DSP.resample will certainly downsample, not sure about upsample.

---

<div class="post-metadata">

**Author:** ![ForceBru](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/forcebru/32/21389_2.png) [@ForceBru](https://discourse.julialang.org/u/ForceBru)\
**Post date:** [March 22, 2023, 3:14pm UTC](https://discourse.julialang.org/t/timeseries-jl-and-upsampling/88896/4 "2023-03-22T15:14:35Z")

</div>

I stumbled upon this problem too, but haven’t found any solution so far:

- [Here](https://discourse.julialang.org/t/package-for-resampling-of-an-unevenly-spaced-time-series-to-an-evenly-spaced-time-series/28110) people suggest `Interpolations.jl`, but it seems to only work when time is a real value, not a date.
- [Here](https://stackoverflow.com/questions/20816813/resampling-a-dataframe-to-hourly-15min-and-5min-periods-in-julia) [TimeSeriesResampler.jl](https://github.com/femtotrader/TimeSeriesResampler.jl) is recommended, but it seems unmaintained and was last updated 5 years ago.
- There’s [Resampling.jl](https://github.com/johnmyleswhite/Resampling.jl), but it’s unmaintained and was last updated 9 years ago.
- DataFrames.jl doesn’t seem to support indexing by date/time and it seems like the devs [don’t plan to implement this](https://github.com/JuliaData/DataFrames.jl/issues/532).

Python’s Pandas has [`DataFrame.resample`](https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.resample.html?highlight=resample#pandas.DataFrame.resample). Do no Julia packages provide such functionality?
