Skip to main content
10000+ Posts
I would like to compare two sets in a PythonCaller and output the difference between these two sets.

Hi all, In the last few days we've set many small steps leading up to the problem we now have. We have polygons, where one attribute of each polygon is a list of bird species, which occur in that area. This list is of course different for all polygons, the polygon-specific list. We also have a list of bird species which should occur in that area. This list is the same for all polygons (in this subset), the general list. Now, we would like to compare the list of each polygon, with the list for all polygons. We have tried many transformers, and our last option (at the moment) is the PythonCaller, where we hardcode the second list as a set, and compare it with the polygon-specific list, converted to a set. We group by the id of the polygon, because we want to compare each polygon-specific list to the general list. This is our Python-code:import fmeimport fmeobjects x = {'item 1','item 2','item 3'} 

Badge Winners

  • FME Form Advanced Training
    mike_greshhas earned the badge FME Form Advanced Training
  • FME Flow Authoring Training
    lolashas earned the badge FME Flow Authoring Training
  • Welcome Back
    nanothstinehas earned the badge Welcome Back
  • Teacher (Grey)
    lauryn00789has earned the badge Teacher (Grey)
  • Integrate Data with the FME Platform Training
    nwinghas earned the badge Integrate Data with the FME Platform Training
Show all badges

Community Stats

32,431
Posts
123,238
Replies
40,557
Members