Select to view content in your preferred language

Dynamic segmentation with respect to a control factor

5644
12
Jump to solution
05-07-2015 08:51 AM
ChukwuemekaEzeiruaku
Deactivated User

Is there a way either with python scripts or other solution to dynamically segment the following table?

Input table (not a feature class)

 

Item IDBegin End
100001
100105
100217
100345
100435

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 EndItem IDItem ID
0110001001
1310011001; 1002
3410021001; 1002; 1004
4510031001; 1002; 1003; 1004
5710041002

Thanks.

0 Kudos
12 Replies
BlakeTerhune
MVP Frequent Contributor

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 

0 Kudos
ChukwuemekaEzeiruaku
Deactivated User

Hi Blake, your solution worked but i got an error from line 37 as shown in the image.Capture.JPG

Also i got a table with half the records from the input table.

0 Kudos
XanderBakker
Esri Esteemed Contributor

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