<?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 Error code 000732 in Developers Questions</title>
    <link>https://community.esri.com/t5/developers-questions/error-code-000732/m-p/1572542#M7385</link>
    <description>&lt;P&gt;I am creating a script tool, and what I’m trying to do is generate two CSV files from two different layers that belong to different maps. I’ve already tried this in a notebook, and it worked, but when I tried to adapt the script to use parameters, I received error code 000732: &amp;lt;value&amp;gt;: Dataset &amp;lt;value&amp;gt; does not exist or is not supported.&lt;/P&gt;&lt;P&gt;Here’s some useful information:&lt;/P&gt;&lt;P&gt;I first split the script into two parts, where all data comes from the same map, and it works as expected when used as a tool.&lt;BR /&gt;Then, I tried to run the tool with one of the two maps active, and the error message indicated that the issue is with the layer from the inactive map.&lt;BR /&gt;This leads me to believe that the problem might be due to not having all the layers in the same map. But having all the information in one map is not an option.&lt;/P&gt;&lt;P&gt;Here is the script:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;import arcpy&lt;BR /&gt;import pandas as pd&lt;BR /&gt;import os&lt;/P&gt;&lt;P&gt;# Get the "Uso Actual" map&lt;BR /&gt;map_uso_actual = arcpy.GetParameter(0)&lt;/P&gt;&lt;P&gt;# Get the "PDU 2023 7ma Actualización" layer&lt;BR /&gt;layer_uso_actual = arcpy.GetParameter(1)&lt;/P&gt;&lt;P&gt;# Define the relevant fields&lt;BR /&gt;campo_uso_actual = "id_modif_uso"&lt;BR /&gt;campo_area = "sup_ha" # This field represents the area of each polygon&lt;/P&gt;&lt;P&gt;# Load the "Uso Actual" table into a Pandas DataFrame using TableToNumPyArray&lt;BR /&gt;tabla_actual = arcpy.da.TableToNumPyArray(layer_uso_actual, [campo_uso_actual, "uso_suelo", campo_area])&lt;/P&gt;&lt;P&gt;# Convert the table to a Pandas DataFrame&lt;BR /&gt;df_actual = pd.DataFrame(tabla_actual)&lt;/P&gt;&lt;P&gt;# Group 'df_actual' by 'id_modif_uso' and 'uso_suelo' to get the sum of the area&lt;BR /&gt;df_actual_agrupado = df_actual.groupby([campo_uso_actual, "uso_suelo"], as_index=False).agg({&lt;BR /&gt;campo_area: "sum"&lt;BR /&gt;})&lt;/P&gt;&lt;P&gt;# Export the result to a CSV file&lt;BR /&gt;output_csv = r"C:\EsriTraining\resumen_uso_actual2.csv"&lt;BR /&gt;df_actual_agrupado.to_csv(output_csv, index=False)&lt;/P&gt;&lt;P&gt;# Get the "Uso Propuesto" map&lt;BR /&gt;map_uso_propuesto = arcpy.GetParameter(2)&lt;/P&gt;&lt;P&gt;# Get the "PDU 2023 7ma Actualización" layer&lt;BR /&gt;layer_uso_propuesto = arcpy.GetParameter(3)&lt;/P&gt;&lt;P&gt;# Define the relevant fields for the proposed use&lt;BR /&gt;campo_uso_propuesto = "m_id_modif_uso"&lt;BR /&gt;campo_area = "sup_ha" # This field represents the area of each polygon&lt;/P&gt;&lt;P&gt;# Load the "Uso Propuesto" table into a Pandas DataFrame using TableToNumPyArray&lt;BR /&gt;tabla_propuesto = arcpy.da.TableToNumPyArray(layer_uso_propuesto, [campo_uso_propuesto, "uso_suelo", campo_area])&lt;/P&gt;&lt;P&gt;# Convert the table to a Pandas DataFrame&lt;BR /&gt;df_propuesto = pd.DataFrame(tabla_propuesto)&lt;/P&gt;&lt;P&gt;# Group 'df_propuesto' by 'm_id_modif_uso' and 'uso_suelo' to get the sum of the area&lt;BR /&gt;df_propuesto_agrupado = df_propuesto.groupby([campo_uso_propuesto, "uso_suelo"], as_index=False).agg({&lt;BR /&gt;campo_area: "sum"&lt;BR /&gt;})&lt;/P&gt;&lt;P&gt;# Export the result to a CSV file&lt;BR /&gt;output_csv1 = r"C:\EsriTraining\resumen_uso_actual1.csv"&lt;BR /&gt;df_propuesto_agrupado.to_csv(output_csv1, index=False)&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 03 Jan 2025 20:05:34 GMT</pubDate>
    <dc:creator>AaronCrisanto</dc:creator>
    <dc:date>2025-01-03T20:05:34Z</dc:date>
    <item>
      <title>Error code 000732</title>
      <link>https://community.esri.com/t5/developers-questions/error-code-000732/m-p/1572542#M7385</link>
      <description>&lt;P&gt;I am creating a script tool, and what I’m trying to do is generate two CSV files from two different layers that belong to different maps. I’ve already tried this in a notebook, and it worked, but when I tried to adapt the script to use parameters, I received error code 000732: &amp;lt;value&amp;gt;: Dataset &amp;lt;value&amp;gt; does not exist or is not supported.&lt;/P&gt;&lt;P&gt;Here’s some useful information:&lt;/P&gt;&lt;P&gt;I first split the script into two parts, where all data comes from the same map, and it works as expected when used as a tool.&lt;BR /&gt;Then, I tried to run the tool with one of the two maps active, and the error message indicated that the issue is with the layer from the inactive map.&lt;BR /&gt;This leads me to believe that the problem might be due to not having all the layers in the same map. But having all the information in one map is not an option.&lt;/P&gt;&lt;P&gt;Here is the script:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;import arcpy&lt;BR /&gt;import pandas as pd&lt;BR /&gt;import os&lt;/P&gt;&lt;P&gt;# Get the "Uso Actual" map&lt;BR /&gt;map_uso_actual = arcpy.GetParameter(0)&lt;/P&gt;&lt;P&gt;# Get the "PDU 2023 7ma Actualización" layer&lt;BR /&gt;layer_uso_actual = arcpy.GetParameter(1)&lt;/P&gt;&lt;P&gt;# Define the relevant fields&lt;BR /&gt;campo_uso_actual = "id_modif_uso"&lt;BR /&gt;campo_area = "sup_ha" # This field represents the area of each polygon&lt;/P&gt;&lt;P&gt;# Load the "Uso Actual" table into a Pandas DataFrame using TableToNumPyArray&lt;BR /&gt;tabla_actual = arcpy.da.TableToNumPyArray(layer_uso_actual, [campo_uso_actual, "uso_suelo", campo_area])&lt;/P&gt;&lt;P&gt;# Convert the table to a Pandas DataFrame&lt;BR /&gt;df_actual = pd.DataFrame(tabla_actual)&lt;/P&gt;&lt;P&gt;# Group 'df_actual' by 'id_modif_uso' and 'uso_suelo' to get the sum of the area&lt;BR /&gt;df_actual_agrupado = df_actual.groupby([campo_uso_actual, "uso_suelo"], as_index=False).agg({&lt;BR /&gt;campo_area: "sum"&lt;BR /&gt;})&lt;/P&gt;&lt;P&gt;# Export the result to a CSV file&lt;BR /&gt;output_csv = r"C:\EsriTraining\resumen_uso_actual2.csv"&lt;BR /&gt;df_actual_agrupado.to_csv(output_csv, index=False)&lt;/P&gt;&lt;P&gt;# Get the "Uso Propuesto" map&lt;BR /&gt;map_uso_propuesto = arcpy.GetParameter(2)&lt;/P&gt;&lt;P&gt;# Get the "PDU 2023 7ma Actualización" layer&lt;BR /&gt;layer_uso_propuesto = arcpy.GetParameter(3)&lt;/P&gt;&lt;P&gt;# Define the relevant fields for the proposed use&lt;BR /&gt;campo_uso_propuesto = "m_id_modif_uso"&lt;BR /&gt;campo_area = "sup_ha" # This field represents the area of each polygon&lt;/P&gt;&lt;P&gt;# Load the "Uso Propuesto" table into a Pandas DataFrame using TableToNumPyArray&lt;BR /&gt;tabla_propuesto = arcpy.da.TableToNumPyArray(layer_uso_propuesto, [campo_uso_propuesto, "uso_suelo", campo_area])&lt;/P&gt;&lt;P&gt;# Convert the table to a Pandas DataFrame&lt;BR /&gt;df_propuesto = pd.DataFrame(tabla_propuesto)&lt;/P&gt;&lt;P&gt;# Group 'df_propuesto' by 'm_id_modif_uso' and 'uso_suelo' to get the sum of the area&lt;BR /&gt;df_propuesto_agrupado = df_propuesto.groupby([campo_uso_propuesto, "uso_suelo"], as_index=False).agg({&lt;BR /&gt;campo_area: "sum"&lt;BR /&gt;})&lt;/P&gt;&lt;P&gt;# Export the result to a CSV file&lt;BR /&gt;output_csv1 = r"C:\EsriTraining\resumen_uso_actual1.csv"&lt;BR /&gt;df_propuesto_agrupado.to_csv(output_csv1, index=False)&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 03 Jan 2025 20:05:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/developers-questions/error-code-000732/m-p/1572542#M7385</guid>
      <dc:creator>AaronCrisanto</dc:creator>
      <dc:date>2025-01-03T20:05:34Z</dc:date>
    </item>
    <item>
      <title>Re: Error code 000732</title>
      <link>https://community.esri.com/t5/developers-questions/error-code-000732/m-p/1572619#M7386</link>
      <description>&lt;P&gt;First, some minor housekeeping:&lt;/P&gt;&lt;P&gt;When posting code to the forums, it's generally advisable to use a code block for easier reading.&amp;nbsp; Click the ellipsis button ("..."), then click the code button ("&amp;lt;/&amp;gt;").&amp;nbsp; Python should be an option in the menu.&amp;nbsp; If you ever need to post Arcade in the future, the JavaScript option works closely enough.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now, regarding your code:&lt;/P&gt;&lt;P&gt;What are the datatypes on each of those parameters?&amp;nbsp; And specifically what line does the error message cite?&amp;nbsp; Oftentimes, that can be helpful in narrowing down the issue.&lt;/P&gt;&lt;P&gt;It sounds like something somewhere along the way is effectively trying to call&lt;/P&gt;&lt;LI-CODE lang="python"&gt;arcpy.mp.ArcGISProject('Current')&lt;/LI-CODE&gt;&lt;P&gt;, but I don't see where that could be happening, yet.&lt;/P&gt;</description>
      <pubDate>Sat, 04 Jan 2025 06:47:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/developers-questions/error-code-000732/m-p/1572619#M7386</guid>
      <dc:creator>MErikReedAugusta</dc:creator>
      <dc:date>2025-01-04T06:47:39Z</dc:date>
    </item>
  </channel>
</rss>

