The Origin Forum
File Exchange
Try Origin for Free
The Origin Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ | Send File to Tech support
Username:
Password:
Save Password
Forgot your Password? | Admin Options

 All Forums
 Origin Forum
 Origin Forum
 Extracting averages across rows for huge data sets
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

savagemj

South Africa
Posts

Posted - 10/14/2005 :  12:03:50 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Version (Select Help-->About Origin):
Operating System: Win XP

We work with data sets that have nearly two million rows and many columns, each column with its own header and label.

We first work on each column to calculate, for example the cube of (Ti - Ti-2) where Ti is the temperature in row i and Ti-2 that in row i - 2.

Now we want to get the average of these for the first 18000 data rows and then the average for rows 18001 to 36000, etc. down to the bottom of the worksheet. Is there an easy way to do this in the Origin worksheet?

Thanks in advance.

MJS

Mike Buess

USA
3037 Posts

Posted - 10/14/2005 :  4:07:30 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi MJS,

I take it you already know how to get the cubes and only need help with the averaging. In that case you can use the following LabTalk script to extract the averages to a new worksheet.

groupsize=18000;
get col(1) -e nrows; // # rows
%W=%H; // save wks name
win -d; // duplicate
doc -e W {%L=%H}; // find name of duplicate
win -a %L; // activate duplicate
set %H -er int(nrows/groupsize); // reduce # rows
for(ii=1;ii<=wks.ncols;ii++)
{
// average each column
%(%H,ii)=ave(%(%W,ii),groupsize);
};

Mike Buess
Origin WebRing Member
Go to Top of Page
  Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000