spill-the-beans
Board Regular
- Joined
- Feb 7, 2013
- Messages
- 52
Hello,
I have a rather large dataset, and apart from the top row (which is a header row), all the data is either a 0 or a 1. Just looking at one column, I could have something like:
[TABLE="width: 500"]
<tbody>[TR]
[TD]A[/TD]
[TD]B[/TD]
[/TR]
[TR]
[TD]index[/TD]
[TD]data[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]0[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]0[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD]5[/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD]6[/TD]
[TD]0[/TD]
[/TR]
[TR]
[TD]7[/TD]
[TD]0[/TD]
[/TR]
[TR]
[TD]8[/TD]
[TD]0[/TD]
[/TR]
[TR]
[TD]9[/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD]10[/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD]11[/TD]
[TD]0[/TD]
[/TR]
[TR]
[TD]12[/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD]13[/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD]14[/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD]15[/TD]
[TD]1[/TD]
[/TR]
</tbody>[/TABLE]
In another sheet, I would like a summary of information in just the data column B. There are two things I need to know:
1. How many series of 1s (so 2 or more 1s one after the other vertically) there were in the entire column. There will never be a 1 by itself with a 0 both above and below it.
2. How long each individual series was - so how many 1s there were in that vertical series.
So for the example above, I would ideally end up with something that looks like:
[TABLE="width: 500"]
<tbody>[TR]
[TD]How many series?[/TD]
[TD]3[/TD]
[/TR]
[TR]
[TD]Length of 1st series[/TD]
[TD]3[/TD]
[/TR]
[TR]
[TD]Length of 2nd series[/TD]
[TD]2[/TD]
[/TR]
[TR]
[TD]Length of 3rd series[/TD]
[TD]4[/TD]
[/TR]
</tbody>[/TABLE]
If anyone can help me, please let me know! At the moment I am counting by hand!
I have a rather large dataset, and apart from the top row (which is a header row), all the data is either a 0 or a 1. Just looking at one column, I could have something like:
[TABLE="width: 500"]
<tbody>[TR]
[TD]A[/TD]
[TD]B[/TD]
[/TR]
[TR]
[TD]index[/TD]
[TD]data[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]0[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]0[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD]5[/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD]6[/TD]
[TD]0[/TD]
[/TR]
[TR]
[TD]7[/TD]
[TD]0[/TD]
[/TR]
[TR]
[TD]8[/TD]
[TD]0[/TD]
[/TR]
[TR]
[TD]9[/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD]10[/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD]11[/TD]
[TD]0[/TD]
[/TR]
[TR]
[TD]12[/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD]13[/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD]14[/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD]15[/TD]
[TD]1[/TD]
[/TR]
</tbody>[/TABLE]
In another sheet, I would like a summary of information in just the data column B. There are two things I need to know:
1. How many series of 1s (so 2 or more 1s one after the other vertically) there were in the entire column. There will never be a 1 by itself with a 0 both above and below it.
2. How long each individual series was - so how many 1s there were in that vertical series.
So for the example above, I would ideally end up with something that looks like:
[TABLE="width: 500"]
<tbody>[TR]
[TD]How many series?[/TD]
[TD]3[/TD]
[/TR]
[TR]
[TD]Length of 1st series[/TD]
[TD]3[/TD]
[/TR]
[TR]
[TD]Length of 2nd series[/TD]
[TD]2[/TD]
[/TR]
[TR]
[TD]Length of 3rd series[/TD]
[TD]4[/TD]
[/TR]
</tbody>[/TABLE]
If anyone can help me, please let me know! At the moment I am counting by hand!