Oct-24-2018, 10:29 AM
I have a large grid, but let's say it is 4 cells wide and 3 cells high. Index of the first cell is
Each cell has a value. So we have a
cell;value
0;8
1;2
2;1
3;6
4;4
5;6
6;7
7;1
8;2
9;5
10;3
11;5
How do I identify cell that has a
- For corner cells this means that we look at the observed cell and all three around it.
- For middle cells we observe the cell and all 8 around it.
The goal is to find the cell with max value, add to
For the upper example this would mean:
cell;value;maxValue
0;8;1
1;2;0
2;1;0
3;6;0
4;4;0
5;6;0
6;7;1
7;1;0
8;2;0
9;5;0
10;3;0
11;5;0
EDIT:
This is the "image" of the grid and its values, respectively.
IMAGE LINK
Anyone? Should I use
0
and it starts bottom left, finishes in the upper right corner with index 11
.Each cell has a value. So we have a
df
:cell;value
0;8
1;2
2;1
3;6
4;4
5;6
6;7
7;1
8;2
9;5
10;3
11;5
How do I identify cell that has a
max
value around itself? - For corner cells this means that we look at the observed cell and all three around it.
- For middle cells we observe the cell and all 8 around it.
The goal is to find the cell with max value, add to
df
a new column and to the cell with max value return 1
and all the others 0
.For the upper example this would mean:
cell;value;maxValue
0;8;1
1;2;0
2;1;0
3;6;0
4;4;0
5;6;0
6;7;1
7;1;0
8;2;0
9;5;0
10;3;0
11;5;0
EDIT:
This is the "image" of the grid and its values, respectively.
IMAGE LINK
Anyone? Should I use
IF
command and go with if (i+1) and (i-1) and ...
?