<?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 Creating temporary tables in memory in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/creating-temporary-tables-in-memory/m-p/1296638#M67828</link>
    <description>&lt;P&gt;I'm creating a script tool that takes user input and exports those records cleans them in a temporary table and appends them to a separate table. The tool will be run daily so I was trying to set the environment to memory vs a scratch file geodatabase. In the code below it successfully runs up to line 19 where it throws the following error:&amp;nbsp;FileNotFoundError: [Errno 2] No such file or directory: 'memory\temporary_table.csv'. I've tried setting "memory" to "in_memory" which results in the same error. This script is written for ArcGIS Pro 3.1 for reference. Any ideas on how to go about using memory or in_memory?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;import arcpy
import pandas as pd

cleaned_lines = arcpy.GetParameterAsText(0)
cleaned_date = arcpy.GetParameterAsText(1)

# Create temporary directory
ws = "memory"
arcpy.env.scratchWorkspace = ws

# Set table variables
temp_table = ws+"\temporary_table.csv"
related_table = Related Table Path

# Export cleaned_lines
arcpy.conversion.ExportTable(cleaned_lines, temp_table)

# Drop unnecessary fields, clean date, and export csv
df = pd.read_csv(temp_table)
df2 = df[['OBJECTID','FACILITYID']]
df2['CLEANEDDATE'] = cleaned_date
df2.to_csv(temp_table)

# Append csv to related table
arcpy.management.Append(temp_table, related_table, "TEST")

# Delete temporary table
arcpy.Delete_management(temp_table)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 07 Jun 2023 12:57:22 GMT</pubDate>
    <dc:creator>DylanW_TOC</dc:creator>
    <dc:date>2023-06-07T12:57:22Z</dc:date>
    <item>
      <title>Creating temporary tables in memory</title>
      <link>https://community.esri.com/t5/python-questions/creating-temporary-tables-in-memory/m-p/1296638#M67828</link>
      <description>&lt;P&gt;I'm creating a script tool that takes user input and exports those records cleans them in a temporary table and appends them to a separate table. The tool will be run daily so I was trying to set the environment to memory vs a scratch file geodatabase. In the code below it successfully runs up to line 19 where it throws the following error:&amp;nbsp;FileNotFoundError: [Errno 2] No such file or directory: 'memory\temporary_table.csv'. I've tried setting "memory" to "in_memory" which results in the same error. This script is written for ArcGIS Pro 3.1 for reference. Any ideas on how to go about using memory or in_memory?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;import arcpy
import pandas as pd

cleaned_lines = arcpy.GetParameterAsText(0)
cleaned_date = arcpy.GetParameterAsText(1)

# Create temporary directory
ws = "memory"
arcpy.env.scratchWorkspace = ws

# Set table variables
temp_table = ws+"\temporary_table.csv"
related_table = Related Table Path

# Export cleaned_lines
arcpy.conversion.ExportTable(cleaned_lines, temp_table)

# Drop unnecessary fields, clean date, and export csv
df = pd.read_csv(temp_table)
df2 = df[['OBJECTID','FACILITYID']]
df2['CLEANEDDATE'] = cleaned_date
df2.to_csv(temp_table)

# Append csv to related table
arcpy.management.Append(temp_table, related_table, "TEST")

# Delete temporary table
arcpy.Delete_management(temp_table)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 07 Jun 2023 12:57:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/creating-temporary-tables-in-memory/m-p/1296638#M67828</guid>
      <dc:creator>DylanW_TOC</dc:creator>
      <dc:date>2023-06-07T12:57:22Z</dc:date>
    </item>
    <item>
      <title>Re: Creating temporary tables in memory</title>
      <link>https://community.esri.com/t5/python-questions/creating-temporary-tables-in-memory/m-p/1296726#M67846</link>
      <description>&lt;P&gt;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/help/analysis/geoprocessing/basics/the-in-memory-workspace.htm" target="_blank"&gt;Write geoprocessing output to memory—ArcGIS Pro | Documentation&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;To write to the memory workspace, specify an output dataset path beginning with memory\ and with no file extension—for example, memory\tempOutput.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Use of memory-based workspaces in Python is only valid for geoprocessing tools. Memory is not a general-purpose virtual directory where you can write files or other data.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;It doesn't like the "csv" portion&lt;/P&gt;</description>
      <pubDate>Wed, 07 Jun 2023 15:35:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/creating-temporary-tables-in-memory/m-p/1296726#M67846</guid>
      <dc:creator>DanPatterson</dc:creator>
      <dc:date>2023-06-07T15:35:17Z</dc:date>
    </item>
  </channel>
</rss>

