<?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: Creating workforce assignments using arcgis api for python in ArcGIS API for Python Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-python-questions/creating-workforce-assignments-using-arcgis-api/m-p/1097089#M6623</link>
    <description>&lt;P&gt;Hi Jake&lt;/P&gt;&lt;P&gt;Its seems pandas in Jupyter notebook&amp;nbsp; does not recognize columns in my csv and just groups all columns into one.&lt;/P&gt;</description>
    <pubDate>Fri, 10 Sep 2021 06:18:18 GMT</pubDate>
    <dc:creator>SpheleleNtilane7</dc:creator>
    <dc:date>2021-09-10T06:18:18Z</dc:date>
    <item>
      <title>Creating workforce assignments using arcgis api for python</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/creating-workforce-assignments-using-arcgis-api/m-p/1096758#M6621</link>
      <description>&lt;P&gt;My name is Sphe from South Africa and I am relatively new to programming. I am trying to create workforce assignments using Arcgis Api for python but I am failing.&amp;nbsp; I have tried using these scripts from &lt;A href="https://github.com/Esri/workforce-scripts/blob/master/notebooks/examples/2%20-%20Importing%20Assignments.ipynb" target="_blank" rel="noopener"&gt;workforce-scripts/2 - Importing Assignments.ipynb at master · Esri/workforce-scripts (github.com)&lt;/A&gt; but I'm still not winning. I get a&amp;nbsp;Key error when i&amp;nbsp; try to import my assignments from a csv.&lt;/P&gt;&lt;PRE&gt;&lt;SPAN class="ansi-green-intense-fg ansi-bold"&gt;if&lt;/SPAN&gt; tolerance &lt;SPAN class="ansi-green-intense-fg ansi-bold"&gt;is&lt;/SPAN&gt; &lt;SPAN class="ansi-green-intense-fg ansi-bold"&gt;not&lt;/SPAN&gt; &lt;SPAN class="ansi-green-intense-fg ansi-bold"&gt;None&lt;/SPAN&gt;&lt;SPAN class="ansi-yellow-intense-fg ansi-bold"&gt;:&lt;/SPAN&gt;

&lt;SPAN class="ansi-red-intense-fg ansi-bold"&gt;KeyError&lt;/SPAN&gt;: 'Location'&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;This is the part of the code that is giving me a major headache:&lt;/P&gt;&lt;P&gt;csv_file = pd.read_csv('C:/Users/sphelele.ntilane/Desktop/Book.csv')&lt;BR /&gt;csv_file&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;csv_file_assignments = []&lt;/P&gt;&lt;P&gt;for index, row in csv_file.iterrows():&lt;BR /&gt;geometry = geocode(f"{row['Location']} {row['Suburb']}", out_sr=3857)[0]["location"]&lt;BR /&gt;csv_file_assignments.append(&lt;BR /&gt;workforce.Assignment(&lt;BR /&gt;project,&lt;BR /&gt;geometry=geometry,&lt;BR /&gt;location=row["Location"],&lt;BR /&gt;description=row["Description"],&lt;BR /&gt;priority=row["Priority"],&lt;BR /&gt;work_order_id=row["Work Order ID"],&lt;BR /&gt;assignment_type="No_Water",&lt;BR /&gt;status="unassigned"&lt;BR /&gt;)&lt;BR /&gt;)&lt;BR /&gt;project.assignments.batch_add(assignments)&lt;/P&gt;&lt;P&gt;Whoever can assist please do&lt;/P&gt;</description>
      <pubDate>Thu, 09 Sep 2021 14:23:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/creating-workforce-assignments-using-arcgis-api/m-p/1096758#M6621</guid>
      <dc:creator>SpheleleNtilane7</dc:creator>
      <dc:date>2021-09-09T14:23:37Z</dc:date>
    </item>
    <item>
      <title>Re: Creating workforce assignments using arcgis api for python</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/creating-workforce-assignments-using-arcgis-api/m-p/1096844#M6622</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/512193"&gt;@SpheleleNtilane7&lt;/a&gt;&amp;nbsp;can you provide a sample of the CSV your script is querying?&lt;/P&gt;</description>
      <pubDate>Thu, 09 Sep 2021 16:56:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/creating-workforce-assignments-using-arcgis-api/m-p/1096844#M6622</guid>
      <dc:creator>JakeSkinner</dc:creator>
      <dc:date>2021-09-09T16:56:50Z</dc:date>
    </item>
    <item>
      <title>Re: Creating workforce assignments using arcgis api for python</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/creating-workforce-assignments-using-arcgis-api/m-p/1097089#M6623</link>
      <description>&lt;P&gt;Hi Jake&lt;/P&gt;&lt;P&gt;Its seems pandas in Jupyter notebook&amp;nbsp; does not recognize columns in my csv and just groups all columns into one.&lt;/P&gt;</description>
      <pubDate>Fri, 10 Sep 2021 06:18:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/creating-workforce-assignments-using-arcgis-api/m-p/1097089#M6623</guid>
      <dc:creator>SpheleleNtilane7</dc:creator>
      <dc:date>2021-09-10T06:18:18Z</dc:date>
    </item>
    <item>
      <title>Re: Creating workforce assignments using arcgis api for python</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/creating-workforce-assignments-using-arcgis-api/m-p/1097139#M6624</link>
      <description>&lt;P&gt;It looks like your CSV is formatted to use a semi-colon (&lt;STRONG&gt;;&lt;/STRONG&gt;) as the delimeter.&amp;nbsp; Pandas defaults to using a comma (&lt;STRONG&gt;,&lt;/STRONG&gt;).&amp;nbsp; When reading the CSV, specify the delimeter parameter.&amp;nbsp; Ex:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;csv_file = pd.read_csv('C:/Users/sphelele.ntilane/Desktop/Book.csv', delimiter=';')&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 10 Sep 2021 11:05:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/creating-workforce-assignments-using-arcgis-api/m-p/1097139#M6624</guid>
      <dc:creator>JakeSkinner</dc:creator>
      <dc:date>2021-09-10T11:05:17Z</dc:date>
    </item>
  </channel>
</rss>

