<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Merge two data sets with conditions for field placement in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/merge-two-data-sets-with-conditions-for-field/m-p/375386#M29694</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sounds more like you want to do a join, based on the Incident number as the common field between the two. Sounds like a process for &lt;A href="https://community.esri.com/migrated-users/4811"&gt;Richard Fairhurst&lt;/A&gt;‌'s classic dictionary approach:&amp;nbsp;&amp;nbsp;&lt;A href="https://community.esri.com/blogs/richard_fairhurst/2014/11/08/turbo-charging-data-manipulation-with-python-cursors-and-dictionaries"&gt;/blogs/richard_fairhurst/2014/11/08/turbo-charging-data-manipulation-with-python-cursors-and-dictionaries&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 09 Apr 2020 22:56:22 GMT</pubDate>
    <dc:creator>JoeBorgione</dc:creator>
    <dc:date>2020-04-09T22:56:22Z</dc:date>
    <item>
      <title>Merge two data sets with conditions for field placement</title>
      <link>https://community.esri.com/t5/python-questions/merge-two-data-sets-with-conditions-for-field/m-p/375385#M29693</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am attempting to merge two different datasets and need some direction.&lt;/P&gt;&lt;P&gt;The feature (Incident) I have has the following fields:&lt;/P&gt;&lt;P&gt;Incident Number, date and call processing, unit1, raction1, travel1, unit2, reaction2, travel2, .......&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to merge a table (Unit) with the following information:&lt;/P&gt;&lt;P&gt;Incident number, Unit, Reaction, Travel, and sequence.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to take the table and place the information that equals the incident number and place the information into the appropriate field for the units.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Tried using field calculation to come up with a python script, but for the life of me I can't think how to get this done. I tried the following but i keep getting errors.&lt;/P&gt;&lt;P&gt;#Field =&lt;BR /&gt;answer(!UnitData.Apparatus_Name!, !UnitData.Sequence!)&lt;/P&gt;&lt;P&gt;#Code Block&lt;BR /&gt;def answer(unit, seq):&lt;BR /&gt;if seq == 2:&lt;BR /&gt;return unit&lt;BR /&gt;else:&lt;BR /&gt;return None&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the long run, I want to be able to create a script to run to merge the data automatically to populate the data into a single field.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for the thoughts...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Apr 2020 22:47:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/merge-two-data-sets-with-conditions-for-field/m-p/375385#M29693</guid>
      <dc:creator>ChrisGoessl</dc:creator>
      <dc:date>2020-04-09T22:47:10Z</dc:date>
    </item>
    <item>
      <title>Re: Merge two data sets with conditions for field placement</title>
      <link>https://community.esri.com/t5/python-questions/merge-two-data-sets-with-conditions-for-field/m-p/375386#M29694</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sounds more like you want to do a join, based on the Incident number as the common field between the two. Sounds like a process for &lt;A href="https://community.esri.com/migrated-users/4811"&gt;Richard Fairhurst&lt;/A&gt;‌'s classic dictionary approach:&amp;nbsp;&amp;nbsp;&lt;A href="https://community.esri.com/blogs/richard_fairhurst/2014/11/08/turbo-charging-data-manipulation-with-python-cursors-and-dictionaries"&gt;/blogs/richard_fairhurst/2014/11/08/turbo-charging-data-manipulation-with-python-cursors-and-dictionaries&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Apr 2020 22:56:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/merge-two-data-sets-with-conditions-for-field/m-p/375386#M29694</guid>
      <dc:creator>JoeBorgione</dc:creator>
      <dc:date>2020-04-09T22:56:22Z</dc:date>
    </item>
  </channel>
</rss>

