Select to view content in your preferred language

Group Unique Values from Multiple Attribute Fields

2410
15
Jump to solution
06-17-2020 09:58 AM
JaredPilbeam2
MVP Regular Contributor

I'm working with a table with tons of unique values crammed into a field. Is there a pythonic way to group unique values from multiple attribute fields? That way I'd have one symbol for its respective values instead of there being repetitive values. 

So, i'd like the table to be organized into something like this:

I'm able to do something similar with Arcade, but it's limited.  How To: Group unique values from multiple attribute fields in ArcGIS Pro 

Creating a list in Arcade can be verified in the Expression builder, but there are no results. My thread using Arcade: Arcade If Statement for Multiple Unique Values 

0 Kudos
15 Replies
XanderBakker
Esri Esteemed Contributor

Hi Jared Pilbeam ,

I had not noticed the finalgroups file in the ZIP. Sorry about that. I had a look at it and since I felt like Arcade I first created something with that. Let me post that in the other questions so that it makes a little more sense for other that read the thread. After that I will post back here the python code. 

0 Kudos
XanderBakker
Esri Esteemed Contributor

Hi Jared Pilbeam ,

Find below the Python standalone script to do the same. 

#-------------------------------------------------------------------------------
# Name:        categories.py
# Purpose:
#
# Author:      xbakker
#
# Created:     24/06/2020
#-------------------------------------------------------------------------------

def main():
    import arcpy

    # configuration
    fc = r'C:\GeoNet\Jared\Default.gdb\RecyclingLocations_full'  # point to your datasource
    fld_kw = "USER_Keywo"  # your input field
    fld_res = "Category2"  # your output string field

    with arcpy.da.UpdateCursor(fc, (fld_kw, fld_res)) as curs:
        for row in curs:
            keyword_txt = row[0]
            finalgroup = GetPredominantGroup(keyword_txt)
            row[1] = finalgroup
            curs.updateRow(row)


def GetPredominantGroup(keyword_txt):
    sep = ";"
    keywords = keyword_txt.split(sep)
    dct_groups = {}
    for keyword in keywords:
        group = GetGroup(keyword)
        if not group is None:
            if group in dct_groups:
                dct_groups[group] += 1
            else:
                dct_groups[group] = 1

    cntmax = 0
    finalgroup = None
    for group, cnt in dct_groups.items():
        if cnt > cntmax:
            finalgroup = group
            cntmax = cnt

    return finalgroup


def GetGroup(keyword):
    groups = {'Appliance Recycling': 'Air Conditioner;Appliance;Refrigerator;Dishwasher;Dryer;Oven;Stove;Washer;Water Heater',
    'Asbestos Info / Removal Service': 'Asbestos',
    'Automobile & Boat Reuse Recycling': 'Airplane; Automobile;Boat;Car;Recreation Vehicle;RV;Truck',
    'Awards & Recognition': 'Awards (Eco-Award)',
    'Batteries': 'Lead-Acid Batteries;Single Use AA, AAA, C, D, 9-Volt;Batteries - Rechargeable, BackUp;Lead-Acid Batteries;Rechargebale;Disposable Batteries;Rechargeable;Automotive Batteries;Boat Batteries;Lithium Batteries;Button Batteries',
    'Bicycle Reuse Donation': 'Bicycles',
    'Book Recycling': 'Books - Hardcover Recycling;Books - Softcover Recycling',
    'Cellular Telephone Reuse & Recycling': 'Cell Phone - Retail Drop-Off;Cell Phone - Electronic Drop Off',
    'Clean - Up Services': 'Clean-Up of Properties;',
    'Clothing, Linens & Shoe Reuse & Recycling-Drop-Off Locations': 'Clothing;Gym Shoes / Sneakers / HighTops;Linens / Blankets / Tableclothes /  Towels;Textile / Fabrics / Drapes / Curtains;Shoes / Boots;Purse or Handbag',
    'Commercial Hazardous Waste': 'Hazardous Waste Services;Chemical Business Waste',
    'Composting Facilities/Landscape Waste transfer Stations': 'Composting Facilities/Landscape Waste transfer Stations;Landscape Material Recycling',
    'Computer Reuse & Recycling': 'Business Electronic Devices',
    'Construction & Demolition Recycling': 'Asphalt;Brick;Building Construction & Demolition Debris;Carpet;Carpet Padding;Concrete;Dirt;Drywall;Gravel;Padding;Roofing Materials;Shingles;Soil;Stone;Vinyl Siding;Windows;Wood-Untreated;Pallets',
    'Cooking Oil/Grease Recycling & Trap Service': 'Cooking Oil;Grease Recycling;Grease Trap Services',
    'Crayon Recycling': 'Crayons',
    'Curbside Recycling': 'Aerosol Cans (empty) Curbside;Aluminum Can Curbside;Aluminum Foil Curbside;Cardboard & Chipboard Curbside;Curbside Recycling;Glass Bottles & Jars Curbside;Juice Boxes/Drink Pouches Curbside;Paper (magazines, phone bks, etc) Curbside;Plastic #1 (PET) & #2 (HDPE) Containers;Plastic #3, #4, #5, #7, Containers Curbside;Six-Pack Rings Curbside;Tin / Steel Cans (soup,cofffee, etc) Curbside',
    'Demolition Material Recycling & Disposal': 'Construction Material Reuse;Demolition Material Reuse / Recycling',
    'Disposable Batteries': 'Batteries - Single Use AA, AAA, C, D, 9-Volt',
    'Donation': 'Books - Hardcover;Computer Reuse/Donation;Couch;Sofa;Toys',
    'Drum & Cylinder Disposal or Recycling': 'Cylinders;Drums',
    'Dry Cleaners (Green)': 'Dry Cleaning',
    'Electronics': 'Adding Machines;Answering Machines;Calculators;Cameras;Cassettes;CB\'s/Two-way radios;CD Players / Laser Disc Players;CD ROM Drives;CDs, DVDs;Cell Phone - Electronic Drop-Off;Computer Recycling;Computer Recycling Drop-Off;Copy Machine;Cords & Cables;Digital Clocks;DVD Machine;Electronic Mice;Electronics;Fax Machines;Floppy Disks;Hand Held Games;Hard Drives;Joysticks/Game controls;Keyboards;Microwaves;Modems;Monitors;Pagers;Palm Organizers;Paper shredders;Portable Radio; Postage Machines;Printers;Scanner Machines;Speakers/Stereo Systems;String Lights /  Holiday String Lights;Sump Pump;Tape Drives;Telephone;Televisions;Thermometers (digital);Typewriters/Word Processors;UPS Battery Backups;VCR Machine;VHS Tapes;Video Game Players; Zip Drives',
    'Eye Glass Reuse': 'Eye Glasses',
    'Fire Extinguisher Refilling or Recycling': 'Fire Extinguishers',
    'Fluorescent Lights': 'CFLs;Compact Fluorescent Light Bulbs;Fluorescent Lights',
    'Food Donation': 'Food Donation',
    'Furniture & Office Equipment ': 'Book Cases;Cubical Walls;Desks;File Cabinets;Furniture & Office Equipment;Office Chairs',
    'Geothermal Energy': 'Geothermal',
    'Gift Cards': 'Gift Cards (merchant plastic money card)',
    'Green Energy Supplier': 'Energy Supplier',
    'Grocery Bag': 'Grocery Bags',
    'Heating Oil Tank Removal': 'Heating Oil Tank Removal',
    'Household Hazardous Waste (HHW)': 'Aerosol Products;Antifreeze;Automotive Batteries;Automotive Fluid;Boat Batteries;Button Batteries;Cleaning Chemicals;Compact Fluorescent Light Bulbs - HHW Drop-Off;Drain Cleaners;Driveway Sealer;Fertilizers;Fluorescent Light Bulbs;Gasoline-Oil Mix;Hazardous Household Materials;HHW;Household Chemicals;Lawn & garden chemicals;Lithium Batteries;Medication (old or unwanted);Mercury / Mercury Products;Motor Oil;Nail Polish Remover;Oil Filters;Oil-based Paint / Stain / Varnish;Old Gasoline;Paint Thinners;Pesticides;Pool Chemicals;Rechargeable Batteries;Solvents;Thermometers (glass);Used Oil;Medication (old or unwanted);Thermometers (glass);Cough Medicine;Inhalers;Medicated Shampoo;Ointment / Medicated Ointment;Over-the-Counter Medication;Pills, Pharmaceuticals, Medication;Prescription Medication;Sunscreen;Vitamins',
    'Landfill & Transfer Stations': 'Landfills & Transfer Stations;Beverage Carrier Straps;Six-Pack Rings;Plastic #1, PET;Plastic #2, HDPE;Plastic #3, PVC;Plastic #4, LDPE;Plastic #5, PP;Plastic #7, Other Container;Aerosol Cans (empty) Drop-Off;Aluminum Can Recycling Drop-Off ;Aluminum Foil Recycling Drop-Off;Glass Bottles and Jars Drop-Off;Juice Boxes / Drink Pouches  Drop-Off;Tin / Steel Cans (soup, coffee, etc) Drop-Off;',
    'Latex Paint': 'Latex Paint',
    'Lead-base Paint Concerns': 'Lead Paint',
    'Manure': 'Manure',
    'Matress Recycling': 'Matress & Box Springs',
    'Medical Equipment (durable)': 'Canes;Crutches;Portable Toliets;Shower Chairs;Wheelchairs',
    'Medication Drop-Off': 'Cough Medicine;Inhalers;Medicated Shampoo;Ointment / Medicated Ointment;Over-the-Counter Medication;Pills, Pharmaceuticals,Medication;Prescription Medication;Sunscreen;Vitamins',
    'Metal Recycling': 'Scrap Metal;Aluminum / Aluminum Can Scrap;Brass;Copper;Iron;Steel Scrap;',
    'Motor Oil - Bulk': 'Motor Oil in Buk Drums',
    'Motor Oil Recycling (DIY)': 'Motor Oil - DIY',
    'Packaging Materials': 'Packing Peanut ;Styrofoam Peanuts;Cardboard Boxes',
    'Pallet Reuse or Recycling': 'Pallets',
    'Paper Recycling': 'Cardboard;Chipboard;Colored Paper;Construction Paper;Junk Mail;Magazines;Newspaper;Office Paper;Paper Recycling;Shredding Services;Clored Paper',
    'Plastic Carrier Strap Recycling': 'Beverage Carrier Straps;Six-Pack Rings',
    'Plastic Container Recycling': 'Plastic #1, PET;Plastic #2, HDPE;Plastic #3 PVC;Plastic #4, LDPE;Plastic #5, PP;Plastic #7, Other Container',
    'Pop-Tab Recycling': 'Pop-Tab',
    'Printer/Toner Cartridge & Ribbon Recycling': 'Inkjets (Ribbons);Printer/Toner Cartridges',
    'Propane Tank Disposal or Recycling': 'Propane Tanks',
    'Rechargeable Battery': 'Batteries - Rechargeable, BackUp, Lead-Acid;Rechargeable',
    'Recycling and Waste Collection Companies': 'Recycling Collection Company;Garbage Collection Company;Waste Collection Company',
    'Repair Services': 'Sharpening Services',
    'Reuse & Resale Shops': 'Reuse/Resale',
    'Smoke Detectors ': 'Smoke Detectors ',
    'Solar Energy': 'Solar Energy',
    'Styrofoam or Polystyrene Recycling': 'Plastic #6, PS, Polystyrene;Styrofoam',
    'Tire Recycling': 'Tire',
    'Water Conservation': 'Rain Barrels;Rain Garden',
    'Wind Energy': 'Small Wind'}

    for group, keywords in groups.items():
        if keywords.find(keyword) > -1:
            return group

    return None


if __name__ == '__main__':
    main()

Although it does exactly the same as the Arcade expression, it may result in different results. Isn't that fun? 

The reason for this is that when you loop through a dictionary in Python it will not be sorted and the Arcade object will. So if you have two groups with the same amount of counts, it may return a different group. I still think that it might requiere some additional thinking on how to treat features that could belong to multiple groups.

JaredPilbeam2
MVP Regular Contributor

Hi, Xander Bakker

So if you have two groups with the same amount of counts, it may return a different group.

Sorry to drag you back into this. I haven't been able to get all the fields. Is the reason 10 fields are missing related to this?

This returns 52 of the 62 groups of the finalgroups.csv.

 fld_kw = "USER_Keywo"  # your input field
 fld_res = "Keyword"  # your output string field‍‍

#missing fields
Composting Facilities/Landscape Waste transfer Stations
Disposable Batteries
Latex Paint
Matress Recycling
Medical Equipment (durable)
Medication Drop-Off
Motor Oil - Bulk
Pallet Reuse or Recycling
Plastic Carrier Strap Recycling
Plastic Container Recycling
Reuse & Resale Shops


‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍

This returns only 16 fields

fld_kw = "USER_Categ"  # your input field
fld_res = "Keyword"  # your output string field‍‍‍‍‍‍
0 Kudos
XanderBakker
Esri Esteemed Contributor

Hi Jared Pilbeam ,

It is possible to use the script and see why those groups do not appear in the results. I can have a look at it if I'm able to find a couple of minutes to spare.

0 Kudos
JaredPilbeam2
MVP Regular Contributor

Hi Xander Bakker,

Thanks for the reply! I have the feature layer view as the fc variable. Here's the script as I ran it last.
Here's the view: https://willcountygis.maps.arcgis.com/home/item.html?id=227061be60a14cc89946a978b440d227 

Edit 8:57am: I made sure all the groups are in your list, and they are.

#-------------------------------------------------------------------------------
# Name:        categories.py
# Purpose:
#
# Author:      xbakker
#
# Created:     24/06/2020
#-------------------------------------------------------------------------------

def main():
    import arcpy

    # configuration
    fc = r'https://services.arcgis.com/fGsbyIOAuxHnF97m/arcgis/rest/services/Recycling_Locations/FeatureServer/0'  # point to your datasource
    fld_kw = "USER_Categ"  # your input field
    fld_res = "Keyword"  # your output string field

    with arcpy.da.UpdateCursor(fc, (fld_kw, fld_res)) as curs:
        for row in curs:
            keyword_txt = row[0]
            finalgroup = GetPredominantGroup(keyword_txt)
            row[1] = finalgroup
            curs.updateRow(row)


def GetPredominantGroup(keyword_txt):
    sep = ";"
    keywords = keyword_txt.split(sep)
    dct_groups = {}
    for keyword in keywords:
        group = GetGroup(keyword)
        if not group is None:
            if group in dct_groups:
                dct_groups[group] += 1
            else:
                dct_groups[group] = 1

    cntmax = 0
    finalgroup = None
    for group, cnt in dct_groups.items():
        if cnt > cntmax:
            finalgroup = group
            cntmax = cnt

    return finalgroup


def GetGroup(keyword):
    groups = {'Appliance Recycling': 'Air Conditioner;Appliance;Refrigerator;Dishwasher;Dryer;Oven;Stove;Washer;Water Heater',
    'Asbestos Info / Removal Service': 'Asbestos',
    'Automobile & Boat Reuse Recycling': 'Airplane; Automobile;Boat;Car;Recreation Vehicle;RV;Truck',
    'Awards & Recognition': 'Awards (Eco-Award)',
    'Batteries': 'Lead-Acid Batteries;Single Use AA, AAA, C, D, 9-Volt;Batteries - Rechargeable, BackUp;Lead-Acid Batteries;Rechargebale;Disposable Batteries;Rechargeable;Automotive Batteries;Boat Batteries;Lithium Batteries;Button Batteries',
    'Bicycle Reuse Donation': 'Bicycles',
    'Book Recycling': 'Books - Hardcover Recycling;Books - Softcover Recycling',
    'Cellular Telephone Reuse & Recycling': 'Cell Phone - Retail Drop-Off;Cell Phone - Electronic Drop Off',
    'Clean - Up Services': 'Clean-Up of Properties;',
    'Clothing, Linens & Shoe Reuse & Recycling-Drop-Off Locations': 'Clothing;Gym Shoes / Sneakers / HighTops;Linens / Blankets / Tableclothes /  Towels;Textile / Fabrics / Drapes / Curtains;Shoes / Boots;Purse or Handbag',
    'Commercial Hazardous Waste': 'Hazardous Waste Services;Chemical Business Waste',
    'Composting Facilities/Landscape Waste transfer Stations': 'Composting Facilities/Landscape Waste transfer Stations;Landscape Material Recycling',
    'Computer Reuse & Recycling': 'Business Electronic Devices',
    'Construction & Demolition Recycling': 'Asphalt;Brick;Building Construction & Demolition Debris;Carpet;Carpet Padding;Concrete;Dirt;Drywall;Gravel;Padding;Roofing Materials;Shingles;Soil;Stone;Vinyl Siding;Windows;Wood-Untreated;Pallets',
    'Cooking Oil/Grease Recycling & Trap Service': 'Cooking Oil;Grease Recycling;Grease Trap Services',
    'Crayon Recycling': 'Crayons',
    'Curbside Recycling': 'Aerosol Cans (empty) Curbside;Aluminum Can Curbside;Aluminum Foil Curbside;Cardboard & Chipboard Curbside;Curbside Recycling;Glass Bottles & Jars Curbside;Juice Boxes/Drink Pouches Curbside;Paper (magazines, phone bks, etc) Curbside;Plastic #1 (PET) & #2 (HDPE) Containers;Plastic #3, #4, #5, #7, Containers Curbside;Six-Pack Rings Curbside;Tin / Steel Cans (soup,cofffee, etc) Curbside',
    'Demolition Material Recycling & Disposal': 'Construction Material Reuse;Demolition Material Reuse / Recycling',
    'Disposable Batteries': 'Batteries - Single Use AA, AAA, C, D, 9-Volt',
    'Donation': 'Books - Hardcover;Computer Reuse/Donation;Couch;Sofa;Toys',
    'Drum & Cylinder Disposal or Recycling': 'Cylinders;Drums',
    'Dry Cleaners (Green)': 'Dry Cleaning',
    'Electronics': 'Adding Machines;Answering Machines;Calculators;Cameras;Cassettes;CB\'s/Two-way radios;CD Players / Laser Disc Players;CD ROM Drives;CDs, DVDs;Cell Phone - Electronic Drop-Off;Computer Recycling;Computer Recycling Drop-Off;Copy Machine;Cords & Cables;Digital Clocks;DVD Machine;Electronic Mice;Electronics;Fax Machines;Floppy Disks;Hand Held Games;Hard Drives;Joysticks/Game controls;Keyboards;Microwaves;Modems;Monitors;Pagers;Palm Organizers;Paper shredders;Portable Radio; Postage Machines;Printers;Scanner Machines;Speakers/Stereo Systems;String Lights /  Holiday String Lights;Sump Pump;Tape Drives;Telephone;Televisions;Thermometers (digital);Typewriters/Word Processors;UPS Battery Backups;VCR Machine;VHS Tapes;Video Game Players; Zip Drives',
    'Eye Glass Reuse': 'Eye Glasses',
    'Fire Extinguisher Refilling or Recycling': 'Fire Extinguishers',
    'Fluorescent Lights': 'CFLs;Compact Fluorescent Light Bulbs;Fluorescent Lights',
    'Food Donation': 'Food Donation',
    'Furniture & Office Equipment ': 'Book Cases;Cubical Walls;Desks;File Cabinets;Furniture & Office Equipment;Office Chairs',
    'Geothermal Energy': 'Geothermal',
    'Gift Cards': 'Gift Cards (merchant plastic money card)',
    'Green Energy Supplier': 'Energy Supplier',
    'Grocery Bag': 'Grocery Bags',
    'Heating Oil Tank Removal': 'Heating Oil Tank Removal',
    'Household Hazardous Waste (HHW)': 'Aerosol Products;Antifreeze;Automotive Batteries;Automotive Fluid;Boat Batteries;Button Batteries;Cleaning Chemicals;Compact Fluorescent Light Bulbs - HHW Drop-Off;Drain Cleaners;Driveway Sealer;Fertilizers;Fluorescent Light Bulbs;Gasoline-Oil Mix;Hazardous Household Materials;HHW;Household Chemicals;Lawn & garden chemicals;Lithium Batteries;Medication (old or unwanted);Mercury / Mercury Products;Motor Oil;Nail Polish Remover;Oil Filters;Oil-based Paint / Stain / Varnish;Old Gasoline;Paint Thinners;Pesticides;Pool Chemicals;Rechargeable Batteries;Solvents;Thermometers (glass);Used Oil;Medication (old or unwanted);Thermometers (glass);Cough Medicine;Inhalers;Medicated Shampoo;Ointment / Medicated Ointment;Over-the-Counter Medication;Pills, Pharmaceuticals, Medication;Prescription Medication;Sunscreen;Vitamins',
    'Landfill & Transfer Stations': 'Landfills & Transfer Stations;Beverage Carrier Straps;Six-Pack Rings;Plastic #1, PET;Plastic #2, HDPE;Plastic #3, PVC;Plastic #4, LDPE;Plastic #5, PP;Plastic #7, Other Container;Aerosol Cans (empty) Drop-Off;Aluminum Can Recycling Drop-Off ;Aluminum Foil Recycling Drop-Off;Glass Bottles and Jars Drop-Off;Juice Boxes / Drink Pouches  Drop-Off;Tin / Steel Cans (soup, coffee, etc) Drop-Off;',
    'Latex Paint': 'Latex Paint',
    'Lead-base Paint Concerns': 'Lead Paint',
    'Manure': 'Manure',
    'Matress Recycling': 'Matress & Box Springs',
    'Medical Equipment (durable)': 'Canes;Crutches;Portable Toliets;Shower Chairs;Wheelchairs',
    'Medication Drop-Off': 'Cough Medicine;Inhalers;Medicated Shampoo;Ointment / Medicated Ointment;Over-the-Counter Medication;Pills, Pharmaceuticals,Medication;Prescription Medication;Sunscreen;Vitamins',
    'Metal Recycling': 'Scrap Metal;Aluminum / Aluminum Can Scrap;Brass;Copper;Iron;Steel Scrap;',
    'Motor Oil - Bulk': 'Motor Oil in Buk Drums',
    'Motor Oil Recycling (DIY)': 'Motor Oil - DIY',
    'Packaging Materials': 'Packing Peanut ;Styrofoam Peanuts;Cardboard Boxes',
    'Pallet Reuse or Recycling': 'Pallets',
    'Paper Recycling': 'Cardboard;Chipboard;Colored Paper;Construction Paper;Junk Mail;Magazines;Newspaper;Office Paper;Paper Recycling;Shredding Services;Clored Paper',
    'Plastic Carrier Strap Recycling': 'Beverage Carrier Straps;Six-Pack Rings',
    'Plastic Container Recycling': 'Plastic #1, PET;Plastic #2, HDPE;Plastic #3 PVC;Plastic #4, LDPE;Plastic #5, PP;Plastic #7, Other Container',
    'Pop-Tab Recycling': 'Pop-Tab',
    'Printer/Toner Cartridge & Ribbon Recycling': 'Inkjets (Ribbons);Printer/Toner Cartridges',
    'Propane Tank Disposal or Recycling': 'Propane Tanks',
    'Rechargeable Battery': 'Batteries - Rechargeable, BackUp, Lead-Acid;Rechargeable',
    'Recycling and Waste Collection Companies': 'Recycling Collection Company;Garbage Collection Company;Waste Collection Company',
    'Repair Services': 'Sharpening Services',
    'Reuse & Resale Shops': 'Reuse/Resale',
    'Smoke Detectors ': 'Smoke Detectors ',
    'Solar Energy': 'Solar Energy',
    'Styrofoam or Polystyrene Recycling': 'Plastic #6, PS, Polystyrene;Styrofoam',
    'Tire Recycling': 'Tire',
    'Water Conservation': 'Rain Barrels;Rain Garden',
    'Wind Energy': 'Small Wind'}

    for group, keywords in groups.items():
        if keywords.find(keyword) > -1:
            return group

    return None


if __name__ == '__main__':
    main()‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍
0 Kudos
XanderBakker
Esri Esteemed Contributor

Hi Jared Pilbeam ,

I just changed the script to report the missing groups if they appear in any record and some do, but don't get assigned (since it is not the most predominant group). There are however also a couple of groups that don't seem to occur in the data:

Latex Paint 11
Composting Facilities/Landscape Waste transfer Stations 0
Medication Drop-Off 16
Plastic Carrier Strap Recycling 9
Pallet Reuse or Recycling 7
Plastic Container Recycling 15
Motor Oil - Bulk 0
Matress Recycling 0
Medical Equipment (durable) 0
Disposable Batteries 9
Reuse & Resale Shops 0

Please note that I did not run this on your feature service, but on the dataset you shared earlier.