<?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: Export pandas DataFrame to csv file using ArcGIS Pro script tool in ArcGIS Pro Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-questions/export-pandas-dataframe-to-csv-file-using-arcgis/m-p/1290576#M69314</link>
    <description>&lt;P&gt;Get the output csv filename as a&amp;nbsp;parameter (output direction) and use &lt;A href="https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.to_csv.html" target="_self"&gt;df.to_csv&lt;/A&gt; to write it out.&lt;/P&gt;&lt;LI-CODE lang="python"&gt;input_csv = arcpy.GetParameterAsText(0)
output_csv = arcpy.GetParameterAsText(1)
df = pandas.read_csv(input_csv)
#do some calcs
df.to_csv(output_csv, index=False)&lt;/LI-CODE&gt;</description>
    <pubDate>Thu, 18 May 2023 23:58:17 GMT</pubDate>
    <dc:creator>Luke_Pinner</dc:creator>
    <dc:date>2023-05-18T23:58:17Z</dc:date>
    <item>
      <title>Export pandas DataFrame to csv file using ArcGIS Pro script tool</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/export-pandas-dataframe-to-csv-file-using-arcgis/m-p/1290360#M69296</link>
      <description>&lt;P&gt;I've created a script tool in ArcGIS Pro that asks the user to select a csv file, and then reads that csv file into a pandas DataFrame and performs some calculations. I'd like to be able to export a new csv file after the calculations are complete in the same folder as the input csv file.&lt;/P&gt;&lt;P&gt;For example, the user selects the input csv file from (C:\Users\Luis\GIS\input.csv). I'd like to export a new csv at the end of the script to (C:\Users\Luis\GIS\output.csv)&lt;/P&gt;&lt;P&gt;The parameter that reads in the user input is set up as follows:&lt;/P&gt;&lt;PRE&gt;input_csv = arcpy.GetParameterAsText(&lt;SPAN class=""&gt;0&lt;/SPAN&gt;)&lt;/PRE&gt;&lt;P&gt;The data type for this parameter is File is the Tool Properties in ArcGIS Pro.&lt;/P&gt;</description>
      <pubDate>Wed, 17 May 2023 20:19:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/export-pandas-dataframe-to-csv-file-using-arcgis/m-p/1290360#M69296</guid>
      <dc:creator>Luis</dc:creator>
      <dc:date>2023-05-17T20:19:04Z</dc:date>
    </item>
    <item>
      <title>Re: Export pandas DataFrame to csv file using ArcGIS Pro script tool</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/export-pandas-dataframe-to-csv-file-using-arcgis/m-p/1290576#M69314</link>
      <description>&lt;P&gt;Get the output csv filename as a&amp;nbsp;parameter (output direction) and use &lt;A href="https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.to_csv.html" target="_self"&gt;df.to_csv&lt;/A&gt; to write it out.&lt;/P&gt;&lt;LI-CODE lang="python"&gt;input_csv = arcpy.GetParameterAsText(0)
output_csv = arcpy.GetParameterAsText(1)
df = pandas.read_csv(input_csv)
#do some calcs
df.to_csv(output_csv, index=False)&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 18 May 2023 23:58:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/export-pandas-dataframe-to-csv-file-using-arcgis/m-p/1290576#M69314</guid>
      <dc:creator>Luke_Pinner</dc:creator>
      <dc:date>2023-05-18T23:58:17Z</dc:date>
    </item>
  </channel>
</rss>

