Select to view content in your preferred language

Range string and number

1129
5
11-28-2021 11:22 PM
Greta
by
Regular Contributor

Hi

I have a set of overlapping points (1X, 20Z, 1A, 50D, 2B), and I would like to get the min and max values Min: 1A, Max: 50D.
The tool "Summarize attribute" get the min and max of integer.
How do you get the min and max of string + integer automatically?
Would you please let me know if there are any tools or codes available?
Thanks

 

0 Kudos
5 Replies
DanPatterson
MVP Esteemed Contributor

How to extract numbers from a string in Python? - Stack Overflow

That will handle the splitting but not more simply

value = "20Z"

int(value[:-1])

will yield the number part.

Your problem is that you will have to process this to provide 2 arrays, which you can use to summarize by letter.  OR if you don't care about the letter, then just take the min and max of the overlapping points with the new integer identifier 


... sort of retired...
Greta
by
Regular Contributor

Hi

I have a set of overlapping points (1X, 20Z, 1A, 50D, 2B), and I would like to get the min and max values Min: 1A, Max: 50D.
The tool "Summarize attribute" get the min and max of integer.
How do you get the min and max of string + integer automatically?
Would you please let me know if there are any tools or codes available?
Thanks

 

0 Kudos
JoshuaBixby
MVP Esteemed Contributor

@Greta, I am not sure why you re-posted your original question as a reply to Dan's comment.  I suggest you either change the reply or simply delete it since it currently adds no value to the discussion.

0 Kudos
DanPatterson
MVP Esteemed Contributor

it was a double-post so I merged them Josh


... sort of retired...
0 Kudos
Greta
by
Regular Contributor

thank you I will try

0 Kudos