Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.soft-sys.math.mathematica > #12389 > unrolled thread
| Started by | bsyehuda@gmail.com |
|---|---|
| First post | 2012-11-19 22:05 +0000 |
| Last post | 2012-11-19 22:05 +0000 |
| Articles | 1 — 1 participant |
Back to article view | Back to comp.soft-sys.math.mathematica
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
Re: Removing rows from a table bsyehuda@gmail.com - 2012-11-19 22:05 +0000
| From | bsyehuda@gmail.com |
|---|---|
| Date | 2012-11-19 22:05 +0000 |
| Subject | Re: Removing rows from a table |
| Message-ID | <k8eaet$lfl$1@smc.vnet.net> |
DeleteCases looks like a perfect solution to your need
here is some data which is replication of what you posted, with some
"modification"
data = {
{{2008, 2, 1, 12, 0, 0.0}, {2008, 2, 15, 12, 0, 0.0}},
{{2009, 2, 1, 12, 0, 0.0}, {2009, 2, 15, 12, 0, 0.0}},
{{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}},
{{2011, 7, 1, 12, 0, 0.0}, {2011, 7, 15, 12, 0, 0.0}},
{{2011, 8, 1, 12, 0, 0.0}, {2011, 8, 15, 12, 0, 0.0}}}
Now, to remove the specific row, say the one that starts with {2010,7,1,...
use
DeleteCases[data, {{2010, 7, 1, ___}, _}]
Thats it
yehuda
On Mon, Nov 19, 2012 at 12:14 AM, Citzen90210 <peter_bodon@hotmail.com>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.
>
>
>
Back to top | Article view | comp.soft-sys.math.mathematica
csiph-web