Need help with extracting values from a field......

574
2
01-01-2021 02:28 PM
Labels (1)
Scott_Jeffrey
New Contributor II

Hey All,
So I have a coding problem that has been driving me insane.  I am working with a point feature showing geocoded student locations where the data table has a text field "Major Description". The Major Description field provides a textual  description for the students major (e.g., Respiratory Care Therapy, Nursing, Radiation Therapy, etc.).  What I ultimately want to do is to create a symbol set where the student location point symbol is replaced with the "initials" of the major.  In other words, rather than student majors having a color-coded point feature I want to have the students who are majoring in Nursing symbolized with an "N"; Respiratory Therapist would be symbolized with an "RT" and Respiratory Care Therapy would be symbolized with an "RC" and so on.  This way, looking at a map showing, say 100 students,  in the School of Health Professions would be far more intuitive to see the spatial distribution of the majors by the lettering than by the associated point color. 

I have tried several different approaches all to no avail. Any thoughts, recommendations, suggestions (including beverage suggestions to ease this headache((:P))  would be greatly appreciated.

Tags (2)
2 Replies
DanPatterson
MVP Esteemed Contributor

Use Reclassify Field (Data Management)—ArcGIS Pro | Documentation to add a new field with the reclassification to use for the symbology (manual method would seem appropriate).


... sort of retired...
DavidPike
MVP Frequent Contributor

I'd just have a set of if, elifs to transform your records into a new field using field calculator.

def changeText(input_field):
    if (input_field == 'Respiratory Care Therapy') :
        result = 'RC'
    elif (input_field == 'Nursing') :
        result = 'N'
    elif (input_field == 'Radiation Therapy'):
        result = 'RT'
        
    return result

Then label by the new field.

ALabels.png