Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Topic: Removing rows from a table
Replies: 3   Last Post: Nov 21, 2012 7:50 PM

 Messages: [ Previous | Next ]
 Dana DeLouis Posts: 24 Registered: 11/18/12
Re: Removing rows from a table
Posted: Nov 21, 2012 7:50 PM

> Total nubie here and struggling!
> I've worked out how to parse the date column

Hi. Welcome. I don't know, but just in case you are using String Manipulation, here's an idea that changes the format of your date column.
Then, you can use the excellent ideas that others have posted.

data =
{
{"01/01/2010 06:15", 0.04375,4.96188,1.00885,0,0,0},
{"02/05/2010 07:15", 0.05375,5.96188,2.00885,0,0,0},
{"03/07/2010 08:15", 0.06375,6.96188,3.00885,0,0,0},
{"04/08/2010 09:15", 0.07375,7.96188,4.00885,0,0,0}
};

This idea converts the first column of your data so you can use the ideas given by others.

data[[All,1]]=DateList[{#,{"Month","Day","Year","Hour","Minute"}}]&/@data[[All,1]];

data
{
{{2010,1,1,6,15,0.}, 0.04375,4.96188,1.00885,0,0,0},
{{2010,2,5,7,15,0.}, 0.05375,5.96188,2.00885,0,0,0},
{{2010,3,7,8,15,0.}, 0.06375,6.96188,3.00885,0,0,0},
{{2010,4,8,9,15,0.}, 0.07375,7.96188,4.00885,0,0,0}
}

Or, you could go directly into Absolute Time during this conversion process:

// Note: Reset data back to original format

data[[All,1]]=AbsoluteTime[DateList[{#,{"Month","Day","Year","Hour","Minute"}}]]&/@data[[All,1]];

data
{
{3471315300, 0.04375,4.96188,1.00885,0,0,0},
{3474342900, 0.05375,5.96188,2.00885,0,0,0},
{3476938500, 0.06375,6.96188,3.00885,0,0,0},
{3479706900, 0.07375,7.96188,4.00885,0,0,0}
}

= = = = = = = = = =
HTH :>)
Dana DeLouis
Mac & Mathematica 8
= = = = = = = = = =

On Sunday, November 18, 2012 5:17:44 PM UTC-5, Citzen90210 wrote:
> Total nubie here and struggling!
>
>
>
> I have a dataset of approximately 100,000 records of data points recorded at 15 minute intervals. Each row looks something like this:
>
>
>
> {"01/01/2010 06:15", 0.04375, 4.96188, 1.00885, 0, 0, 0}
>
>
>
> I've worked out how to parse the date column so that seems to be under control but now I have a list of date ranges that I need to remove from the dataset. The date ranges to be removed look something like this:
>
>
>
> {{2010, 2, 1, 12, 0, 0.0}, {2010, 2, 15, 12, 0, 0.0}},
>
> {{2010, 7, 1, 12, 0, 0.0}, {2010, 7, 15, 12, 0, 0.0}}
>
>
>
> with the first column representing the start date of the block to be removed and the second column representing the end date of the block, multiple rows represent multiple blocks to be removed and the total number of blocks is variable.
>
>
>
> Ideally I'd like to be able to use Drop or Delete to remove the offending blocks of data but I want to be able to somehow feed the command with the date range table and have it remove the ranges all in one go.
>
>
>
> I'm not having much luck working this out for myself and would love to get a few pointers.

Date Subject Author
11/19/12 yehuda ben-shimol
11/21/12 Dana DeLouis
11/21/12 Dana DeLouis