Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Series.Diff method that operates on DateTime to return series of TimeSpan #565

Open
totalgit74 opened this issue Jun 27, 2024 · 0 comments

Comments

@totalgit74
Copy link

Currently Series has a diff method that operates on decimal, double, float and int. Could DateTime also be handled?

Series<K, TimeSpan> Diff<K>(this Series<K, DateTime> series, int offset) would be handy when trying to ascertain periodicity of a Frame by extracting the timestamp column and comparing a shift(1). That way you can see if it is constant or varying and, if so, the min and max interval lengths. The calculation can be done externally but is likely more efficient if implemented internally.

An example would be dealing with a time-series of data that could be either 30 minute or 5 minute intervals but you don't know which as you load the data from files. It could even be a mix.
In the first two cases the output of your processing keeps the input interval length whereas in the latter case you reject the file/do not process it.
The interval length is needed because you need to rebase the series by shifting times by 1 interval length should a flag be set.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant