<?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: Using Python to automate task in excel in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/using-python-to-automate-task-in-excel/m-p/152705#M11778</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I looked at Panda and it seems to be pretty user friendly.&amp;nbsp; One last question - is Panda a RDBMS like PostgreSQL, one that is friendly with geodatabases? &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 26 Jan 2016 21:07:23 GMT</pubDate>
    <dc:creator>nataliemartinkus1</dc:creator>
    <dc:date>2016-01-26T21:07:23Z</dc:date>
    <item>
      <title>Using Python to automate task in excel</title>
      <link>https://community.esri.com/t5/python-questions/using-python-to-automate-task-in-excel/m-p/152700#M11773</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello GIS community,&lt;/P&gt;&lt;P&gt;I have a spreadsheet exported from a shapefile attribute table of Fores_Ownership_by_County for each of 4 states in the Pacific Northwest.&amp;nbsp; It is a very large spreadsheet (lots of rows), with the data representing small polys of forested area in each county. Of the many columns, there is a column for County Name (called instName below) and one for Owner Type (U.S. Forest Service, Private, State, or Non-USFS - Fed (Other Public-Fed below)).&amp;nbsp; I also have a spreadsheet listing the harvested forest biomass density for each county by ownership, see below, one for the county name and a density listed for each of the 4 ownership types. I would like to write a Python code to automate this task of looking in the density sheet for the county name and owner type, and reporting the density in the large sheet, but I am new to Python and am stuck. Any help would be appreciated. Especially if there is a way to write the program to run in GIS and populate the Forest Ownership by County attribute table directly.&amp;nbsp;&amp;nbsp; Below are two snapshots of the two worksheets I am talking about: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Forest Ownership by County worksheet:&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-3 jive-image" height="271" src="https://community.esri.com/legacyfs/online/173465_pastedImage_2.png" style="height: 271px; width: 840.1px;" width="840" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Density Worksheet:&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-2 jive-image" src="https://community.esri.com/legacyfs/online/173347_pastedImage_1.png" style="max-width: 1200px; max-height: 900px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Many thanks,&lt;/P&gt;&lt;P&gt;natalie&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Jan 2016 21:42:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/using-python-to-automate-task-in-excel/m-p/152700#M11773</guid>
      <dc:creator>nataliemartinkus1</dc:creator>
      <dc:date>2016-01-25T21:42:47Z</dc:date>
    </item>
    <item>
      <title>Re: Using Python to automate task in excel</title>
      <link>https://community.esri.com/t5/python-questions/using-python-to-automate-task-in-excel/m-p/152701#M11774</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If this is a pure spreadsheet issue, I would suggest using the macro languages that exist within the spreadsheet.&amp;nbsp; There is no point in bringing GIS into this nor python.&amp;nbsp; Should you wish to get out of a spreadsheet environment, then use a database.&amp;nbsp; If you do have a need for the mapping component, then the same recommendation would apply.&amp;nbsp; If you really really want to use python, then I would recommend looking at 2nd party python interfaces to database programs.&amp;nbsp; Pandas works well with Python which works well with GIS (arcgis and others).&amp;nbsp; So your solution is based upon the trajectory you want to take.&amp;nbsp; Reorganization of your workflow might be a suggestion to go from comfortable to efficient.&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Jan 2016 22:05:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/using-python-to-automate-task-in-excel/m-p/152701#M11774</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2016-01-25T22:05:38Z</dc:date>
    </item>
    <item>
      <title>Re: Using Python to automate task in excel</title>
      <link>https://community.esri.com/t5/python-questions/using-python-to-automate-task-in-excel/m-p/152702#M11775</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;My end goal is to create of map of forested density by county.&amp;nbsp; I don't know how to write macros in excel, and I am in the process of learning Python so I'd prefer to stick to one language for now.&amp;nbsp; I just completed a Coursera class on databases, and I see your point that I could create a relationship between the two spreadsheets based on county name, but again I am new to databases.&amp;nbsp; I also know I can write a very long Python script using if-elif-else logic which would work, but would take a lot of time to write.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Do you know of any good reference material for learning how to work with excel tables in geodatabases to manipulate attribute tables?&amp;nbsp; I am graduating with my PhD in Civil Engineering this summer, and my end product needs to be a GIS tool for biorefinery siting. My data consists of a mix of Network Analyst network datasets, points representing pulp mills, and a few workbooks.&amp;nbsp; I assume I will either go the ModelBuilder route or Python route, but in either case I need to understand how all the disparate datasets can work together to come up with a great answer.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Jan 2016 22:21:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/using-python-to-automate-task-in-excel/m-p/152702#M11775</guid>
      <dc:creator>nataliemartinkus1</dc:creator>
      <dc:date>2016-01-25T22:21:44Z</dc:date>
    </item>
    <item>
      <title>Re: Using Python to automate task in excel</title>
      <link>https://community.esri.com/t5/python-questions/using-python-to-automate-task-in-excel/m-p/152703#M11776</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Some options within ArcGIS are:&lt;/P&gt;&lt;P&gt;- convert your &lt;A href="http://resources.arcgis.com/en/help/main/10.2/index.html#/Excel_To_Table/001200000055000000/"&gt;Excel(s) to table(s)&lt;/A&gt;, then process as usual&lt;/P&gt;&lt;P&gt;- work directly with your Excel sheets, using the xlrd library (import xlrd) packaged with ArcGIS - this is how ESRI accesses Excel within geoprocessing tools (look for yourself in: c:\program files (x86)\arcgis\desktop10.2\ArcToolbox\Scripts\ExcelToTable.py)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Jan 2016 22:36:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/using-python-to-automate-task-in-excel/m-p/152703#M11776</guid>
      <dc:creator>DarrenWiens2</dc:creator>
      <dc:date>2016-01-25T22:36:52Z</dc:date>
    </item>
    <item>
      <title>Re: Using Python to automate task in excel</title>
      <link>https://community.esri.com/t5/python-questions/using-python-to-automate-task-in-excel/m-p/152704#M11777</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ok... game plan is clear.&amp;nbsp; Might I suggest you looking into Modelbuilder and Python for automating your workflow and a list of the tools that you might use from Arctoolbox in that workflow.&amp;nbsp; So here are some basic links.&amp;nbsp; The sublinks will keep you going for quite some time.&amp;nbsp; As I recommend to my students, keep a subfolder of links related to this project in your browser so you can create a tree of useful links.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;A href="http://desktop.arcgis.com/en/desktop/latest/main/analyze/what-is-geoprocessing.htm" title="http://desktop.arcgis.com/en/desktop/latest/main/analyze/what-is-geoprocessing.htm"&gt;What is geoprocessing?—Help | ArcGIS for Desktop&lt;/A&gt; root link&lt;/LI&gt;&lt;LI&gt;&lt;A href="http://desktop.arcgis.com/en/desktop/latest/analyze/modelbuilder/what-is-modelbuilder.htm" title="http://desktop.arcgis.com/en/desktop/latest/analyze/modelbuilder/what-is-modelbuilder.htm"&gt;What is ModelBuilder?—Help | ArcGIS for Desktop&lt;/A&gt; the main link and sublinks and tutorial access&lt;/LI&gt;&lt;LI&gt;&lt;A href="http://desktop.arcgis.com/en/desktop/latest/analyze/python/what-is-python-.htm" title="http://desktop.arcgis.com/en/desktop/latest/analyze/python/what-is-python-.htm"&gt;What is Python?—Help | ArcGIS for Desktop&lt;/A&gt; some basics&lt;/LI&gt;&lt;LI&gt;&lt;A href="http://desktop.arcgis.com/en/desktop/latest/analyze/creating-tools/a-quick-tour-of-creating-tools.htm" title="http://desktop.arcgis.com/en/desktop/latest/analyze/creating-tools/a-quick-tour-of-creating-tools.htm"&gt;A quick tour of creating custom tools—Help | ArcGIS for Desktop&lt;/A&gt;&lt;/LI&gt;&lt;LI&gt;&lt;A href="http://desktop.arcgis.com/en/desktop/latest/tools/3d-analyst-toolbox/an-overview-of-the-3d-analyst-toolbox.htm" title="http://desktop.arcgis.com/en/desktop/latest/tools/3d-analyst-toolbox/an-overview-of-the-3d-analyst-toolbox.htm"&gt;An overview of the 3D Analyst toolbox—Help | ArcGIS for Desktop&lt;/A&gt; Now this isn't just 3D analyst, but you have to select the main link to get the sub tools like.&lt;UL&gt;&lt;LI&gt;&lt;A href="http://desktop.arcgis.com/en/desktop/latest/tools/network-analyst-toolbox/an-overview-of-the-network-analyst-toolbox.htm" title="http://desktop.arcgis.com/en/desktop/latest/tools/network-analyst-toolbox/an-overview-of-the-network-analyst-toolbox.htm"&gt;An overview of the Network Analyst toolbox—ArcGIS Pro | ArcGIS for Desktop&lt;/A&gt;&lt;/LI&gt;&lt;LI&gt;&lt;A href="http://desktop.arcgis.com/en/desktop/latest/tools/analysis-toolbox/an-overview-of-the-analysis-toolbox.htm" title="http://desktop.arcgis.com/en/desktop/latest/tools/analysis-toolbox/an-overview-of-the-analysis-toolbox.htm"&gt;An overview of the Analysis toolbox—Help | ArcGIS for Desktop&lt;/A&gt;&lt;/LI&gt;&lt;LI&gt;&lt;A href="http://desktop.arcgis.com/en/desktop/latest/tools/data-management-toolbox/an-overview-of-the-data-management-toolbox.htm" title="http://desktop.arcgis.com/en/desktop/latest/tools/data-management-toolbox/an-overview-of-the-data-management-toolbox.htm"&gt;An overview of the Data Management toolbox—Help | ArcGIS for Desktop&lt;/A&gt; &lt;/LI&gt;&lt;LI&gt;et etc&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;The key is the code snippets which will get you going.&amp;nbsp; If sounds like you are going to need basic query tools, tools for joining and calculating and the like.&amp;nbsp; Good luck&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Jan 2016 22:48:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/using-python-to-automate-task-in-excel/m-p/152704#M11777</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2016-01-25T22:48:39Z</dc:date>
    </item>
    <item>
      <title>Re: Using Python to automate task in excel</title>
      <link>https://community.esri.com/t5/python-questions/using-python-to-automate-task-in-excel/m-p/152705#M11778</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I looked at Panda and it seems to be pretty user friendly.&amp;nbsp; One last question - is Panda a RDBMS like PostgreSQL, one that is friendly with geodatabases? &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 Jan 2016 21:07:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/using-python-to-automate-task-in-excel/m-p/152705#M11778</guid>
      <dc:creator>nataliemartinkus1</dc:creator>
      <dc:date>2016-01-26T21:07:23Z</dc:date>
    </item>
    <item>
      <title>Re: Using Python to automate task in excel</title>
      <link>https://community.esri.com/t5/python-questions/using-python-to-automate-task-in-excel/m-p/152706#M11779</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Natalie... I don't do that database stuff... so I will defer to the expertise of their homepage.&amp;nbsp; You can also query the help once you have arcgis pro installed ... even if you don't intend to use it... since python 3.4, scipy, matplotlib, pandas sympy and numpy are all installed... leanly.&amp;nbsp; Pandas is largely numpy with a user friendly interface, so if you are comfortable with one, then the other isn't that hard to pick up&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 Jan 2016 21:33:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/using-python-to-automate-task-in-excel/m-p/152706#M11779</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2016-01-26T21:33:09Z</dc:date>
    </item>
    <item>
      <title>Re: Using Python to automate task in excel</title>
      <link>https://community.esri.com/t5/python-questions/using-python-to-automate-task-in-excel/m-p/152707#M11780</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;pandas is just a python library that offers some somewhat friendly methods for grouping and working with data.&amp;nbsp; I wouldn't equate it with SQL, but it may help in many instances where your data is not in an RDBMS or you cannot perform the SQL on the database.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It is friendly with geodatabases in the sense that you can convert your Feature Classes or gdb tables to numpy arrays with &lt;SPAN class="n"&gt;arcpy&lt;/SPAN&gt;&lt;SPAN class="o"&gt;.&lt;/SPAN&gt;&lt;SPAN class="n"&gt;da&lt;/SPAN&gt;&lt;SPAN class="o"&gt;.&lt;/SPAN&gt;&lt;SPAN class="n"&gt;FeatureClassToNumPyArray and then perform your required processing/analysis.&amp;nbsp; If you require saving states of that analysis, you will have to reverse the process to create outputs in your gdb, or not -- just use the results in_memory or as temporary states of data.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="n"&gt;&lt;BR /&gt;It works well.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 Jan 2016 21:48:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/using-python-to-automate-task-in-excel/m-p/152707#M11780</guid>
      <dc:creator>JamesCrandall</dc:creator>
      <dc:date>2016-01-26T21:48:43Z</dc:date>
    </item>
    <item>
      <title>Re: Using Python to automate task in excel</title>
      <link>https://community.esri.com/t5/python-questions/using-python-to-automate-task-in-excel/m-p/152708#M11781</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Would an attribute join not work? You may have to clean up &lt;EM&gt;&lt;STRONG&gt;County_Nm&lt;/STRONG&gt;&lt;/EM&gt; in your density worksheet (before you bring it into ArcMap) to fit the expected names in &lt;EM&gt;&lt;STRONG&gt;instName&lt;/STRONG&gt;&lt;/EM&gt; in your &lt;SPAN style="color: #000000; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;Forest Ownership by County table. It looks like it is going to be a 1 to many join so maybe using the tool Make Query Table &lt;A href="http://resources.arcgis.com/en/help/main/10.2/index.html#//00170000006r000000" title="http://resources.arcgis.com/en/help/main/10.2/index.html#//00170000006r000000"&gt;(ArcGIS Help)&lt;/A&gt; could also be helpful.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;If you want to do it in excel you can use good old MS Query (&lt;A href="https://support.office.com/en-us/article/Use-Microsoft-Query-to-retrieve-external-data-42a2ea18-44d9-40b3-9c38-4c62f252da2e" title="https://support.office.com/en-us/article/Use-Microsoft-Query-to-retrieve-external-data-42a2ea18-44d9-40b3-9c38-4c62f252da2e"&gt;Use Microsoft Query to retrieve external data - Excel)&lt;/A&gt;​. But you would still need to clean up &lt;STRONG&gt;&lt;EM&gt;County_Nm&lt;/EM&gt;&lt;/STRONG&gt;. You just need to bring in the two tables separately and then do the join.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;As you intend to make a map later on, doing it in ArcMap is probably best.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Jan 2016 06:40:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/using-python-to-automate-task-in-excel/m-p/152708#M11781</guid>
      <dc:creator>MikeCusi</dc:creator>
      <dc:date>2016-01-27T06:40:59Z</dc:date>
    </item>
    <item>
      <title>Re: Using Python to automate task in excel</title>
      <link>https://community.esri.com/t5/python-questions/using-python-to-automate-task-in-excel/m-p/152709#M11782</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I was waiting for someone to comment on my County naming convention &lt;IMG src="https://community.esri.com/legacyfs/online/emoticons/happy.png" /&gt;&amp;nbsp; There is actually another column in that big table that matches up nicely with the County_Nm in the Density table.&amp;nbsp; I really like the idea of creating a SQL query but wouldn't I have to create another Density table with one column for county, one column for TPO owner type, and one column for density to use in the query ?&amp;nbsp; I am very new to SQL and databases, but I dont believe the TPO Owner column in my large spreadsheet can reference a column heading in the Density table, where the corresponding density value is taken and applied back to the large spreadsheet. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As a side note, I was able to write a very long if-elif-else code to populate the density column, but I have to do this for 3 more states so I'd love to find a quicker way.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks for your help.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Jan 2016 19:48:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/using-python-to-automate-task-in-excel/m-p/152709#M11782</guid>
      <dc:creator>nataliemartinkus1</dc:creator>
      <dc:date>2016-01-27T19:48:23Z</dc:date>
    </item>
  </channel>
</rss>

