Is there a way either with python scripts or other solution to dynamically segment the following table?
Input table (not a feature class)
Item ID | Begin | End |
1000 | 0 | 1 |
1001 | 0 | 5 |
1002 | 1 | 7 |
1003 | 4 | 5 |
1004 | 3 | 5 |
Each segmented section (from-to) should have all the item numbers written to a field that is within a certain range. From the input table, the final table should look like the one below:
Output table
Begin | End | Item ID | Item ID |
0 | 1 | 1000 | 1001 |
1 | 3 | 1001 | 1001; 1002 |
3 | 4 | 1002 | 1001; 1002; 1004 |
4 | 5 | 1003 | 1001; 1002; 1003; 1004 |
5 | 7 | 1004 | 1002 |
Thanks.
Solved! Go to Solution.
I knew there had to be a numpy solution too; unfortunately, I know squat about it. I also like your dictionary comprehension line with the search cursor better than mine. Thanks for posting, Xander Bakker
Hi Blake, your solution worked but i got an error from line 37 as shown in the image.
Also i got a table with half the records from the input table.
I have marked this question as answered and branched the additional question to a new thread:
Re: Dynamic segmentation with respect to a control factor Additional Requirements