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

  • SEARCH
  • Home
  • 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 9145121
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T10:26:07+00:00 2026-06-17T10:26:07+00:00

My datatable has 19 columns with the first column all filled with timestamps in

  • 0

My datatable has 19 columns with the first column all filled with timestamps in milliseconds:
18491
18591
18691
…

Randomly in the timestamp column, the time will change from +100 increments to +50 increments:
20291
20341
20391
20441
…

and back again, multiple times.

The other columns have different values of data spread about at different frequencies such as 1 Hz, 5Hz, 10Hz with double.NaN in between the values.

What is the best way to average these columns to 1Hz data while neglecting the NaN cells and creating a new datatable with only 1Hz data and no blanks?
i.e.:

From:
Time Col1 Col2 Col3 Col4 Col5
18491 4.0 2.2 NaN 1.0 NaN
18591 NaN NaN 1.0 1.0 NaN
18691 NaN 3.2 NaN 2.0 NaN
18791 NaN NaN NaN 3.0 NaN
18891 NaN 4.4 NaN 1.0 NaN
18991 NaN NaN NaN 4.0 NaN
19091 NaN 1.4 6.0 4.0 NaN
19191 NaN NaN NaN 3.0 NaN
19291 NaN 3.2 NaN 2.0 NaN
19341 NaN NaN NaN NaN 2.0
19391 NaN NaN NaN 3.0 NaN
19441 6.0 3.4 NaN NaN 1.0
19491 NaN NaN NaN 2.0 NaN
19541 NaN NaN NaN NaN 3.0
19591 NaN NaN 3.0 4.0 NaN
19641 NaN 5.2 NaN NaN 1.0
19691 NaN NaN NaN 2.0 NaN
19791 NaN NaN NaN 1.0 NaN
19891 NaN 4.1 NaN 0.0 NaN
19991 NaN NaN NaN 2.0 NaN
20091 NaN 2.2 4.0 1.0 NaN
20191 NaN NaN NaN 1.0 NaN
20291 NaN 5.1 NaN 1.0 NaN
20391 NaN NaN NaN 1.0 NaN
20491 5.0 3.3 NaN 2.0 NaN

To:
Time Col1 Col2 Col3 Col4 Col5
18491 4.0 2.2 NaN 1.0 NaN
19491 6.0 3.21 3.5 2.5 1.5
20491 5.0 3.98 3.5 1.5 2.0

Any help is appreciated, I’m still new to C# and datatables so thank you all in advance!

  • 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. Editorial Team
    Editorial Team
    2026-06-17T10:26:08+00:00Added an answer on June 17, 2026 at 10:26 am
    With Rounded as
    (
       Select ROUND(SomeColumn, -3) as RoundedToThousands From SomeTable
    )
    Select RoundedToThousands, Count(*) from Rounded 
    Group By RoundedToThousands
    

    You will need to modify the rounding logic to match your requirements for how you decides 491 vs 441 as the round to number. Probably some combination of floor instead of round, and then + 491.

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

Sidebar

Related Questions

How to replace column value when looping rows? My DataTable has two columns, I
I have one sqlserver 2008 r2 datatable, it has one column autoId int identity(1,1),
I have one DataTable which has four columns such as MileStoneID MileStoneName Percentage SeqNbr
We have a data table with 3 columns, the first has a selectBooleanCheckbox and
I made a datatable with 2 columns a transactionTime column and a numberOfTransactions column.
I have 2 workbooks. First is called June2122.xls It has columns such as Last
I have one datatable which has four or five columns. I dont know exactly
I have a datatable I'm using which has 5 columns ( http://datatables.net/ ) The
I have two datatables. Each has three columns, the two of them have the
I have a method private static DataTable ParseTable(HtmlNode table) and sometimes this method has

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.