Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 68213
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T19:22:53+00:00 2026-05-10T19:22:53+00:00

I am designing a simple internal framework for handling time series data. Given that

  • 0

I am designing a simple internal framework for handling time series data. Given that LINQ is my current toy hammer, I want to hit everything with it.

I want to implement methods in class TimeSeries (Select(), Where() and so on) so that I can use LINQ syntax to handle time series data

Some things are straight forward, e.g. (from x in A select x+10), giving a new time series.

What is the best syntax design for combining two or more time series? (from a in A from b in B select a+b) is not great, since it expresses a nested loop. Maybe some join? This should correspond to join on the implicit time variable. (What I have in mind corresponds to the lisp ‘zip’ function)


EDIT: Some clarification is necessary.

A time series is a kind of function depending on time, e.g. stock quotes. A combination of time series could be the difference between two stock prices, as a function of time.

Stock1.MyJoin(Stock2, (a,b)=>a-b) 

is possible, but can this be expressed neatly using some LINQ syntax? I am expecting to implement LINQ methods in class MyTimeSeries myself.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-10T19:22:53+00:00Added an answer on May 10, 2026 at 7:22 pm

    If I’m understanding the question correctly, you want to join multiple sequences based on their position within the sequence?

    There isn’t anything in the System.Linq.Enumerable class to do this as both the Join and GroupJoin methods are based on join keys. However, by coincidence I wrote a PositionalJoin method for just this purpose a few days back, used as in your example:

    sequenceA.PositionalJoin(sequenceB, (a, b) => new { a, b }); 

    The semantics of the method shown below is that it does not require the sequences to be of equal length, but it would be trivial to modify it to require this. I also commented out where the argument checking should be as it was using our internal helper classes.

    public static IEnumerable<TResult> PositionalJoin<T1, T2, TResult>(     this IEnumerable<T1> source1,      IEnumerable<T2> source2,      Func<T1, T2, int, TResult> selector) {     // argument checking here     return PositionalJoinIterator(source1, source2, selector); }  private static IEnumerable<TResult> PositionalJoinIterator<T1, T2, TResult>(     IEnumerable<T1> source1,      IEnumerable<T2> source2,      Func<T1, T2, TResult> selector) {     using (var enumerator1 = source1.GetEnumerator())     using (var enumerator2 = source2.GetEnumerator())     {         bool gotItem;         do         {             gotItem = false;              T1 item1;             if (enumerator1.MoveNext())             {                 item1 = enumerator1.Current;                 gotItem = true;             }             else             {                 item1 = default(T1);             }              T2 item2;             if (enumerator2.MoveNext())             {                 item2 = enumerator2.Current;                 gotItem = true;             }             else             {                 item2 = default(T2);             }              if (gotItem)             {                 yield return selector(item1, item2);             }         }         while (gotItem);     } } 

    Not sure if this is exactly what you’re looking for, but hopefully of some help.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 111k
  • Answers 111k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer The options (or preferences) button in the Firefox add-ons window… May 11, 2026 at 9:45 pm
  • Editorial Team
    Editorial Team added an answer Thanks for the suggestions guys. I figured it out. The… May 11, 2026 at 9:45 pm
  • Editorial Team
    Editorial Team added an answer (3, 'test test test test');Either store the tags with hypens… May 11, 2026 at 9:45 pm

Related Questions

Visual Studio 2008 does a much better job of detecting and adding controls from
I am designing a system which will at some point require to send email
I am designing a table in the database which will store log entries from
I've created a table in Microsoft Sql CE that I'm using to hold some

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.