<?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: Select_analysis in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/select-analysis/m-p/117829#M9249</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;You have a few issues, not sure if they are related to the problem you are having or some mistake in copying your code. Your where_clause has a syntax error and your in_features variable should be raw stringed or you should be setting your workspace to the FGDB.&lt;BR /&gt;&lt;BR /&gt;Something like this&lt;BR /&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Actually my issues have nothing to do with what you stated as it reads my in_features correctly and my where_clause works fine as well.&amp;nbsp; If you read my issues it has to do with the output and output only. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;The results of my code is the Input file becomes what is expected in the Output and the Output becomes a copy of the Original Input.&amp;nbsp; &lt;/STRONG&gt;&lt;SPAN&gt;This and only this is the issue I am trying to get resolved.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;If my where_clause was wrong the output file would give me different results but the Input file now has the results that I expected in the Output (as per my where_clause).&amp;nbsp; Also if my input was wrong I would get an error as there would be nothing to read.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Example:&lt;/SPAN&gt;&lt;BR /&gt;&lt;STRONG&gt;Input (linefile)&lt;BR /&gt;&lt;/STRONG&gt;&lt;SPAN&gt;Name, Shape_length&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;A, 1.508&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;B, 0&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;C, 2.134&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;Ouput&lt;/STRONG&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;STRONG&gt;(linefile_zeros.shp)&lt;BR /&gt;&lt;/STRONG&gt;&lt;SPAN&gt;Name, Shape_length&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;A, 1.508&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;B, 0&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;C, 2.134&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;(linefile)&lt;BR /&gt;&lt;/STRONG&gt;&lt;SPAN&gt;Name, Shape_length&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;B, 0&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 23 May 2012 17:01:37 GMT</pubDate>
    <dc:creator>ScottBlankenbeckler</dc:creator>
    <dc:date>2012-05-23T17:01:37Z</dc:date>
    <item>
      <title>Select_analysis</title>
      <link>https://community.esri.com/t5/python-questions/select-analysis/m-p/117827#M9247</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Not sure if this is a bug or as intended.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;# Set local variables
in_features = "working.gdb\linefile"
out_feature_class = "C:/output/linefile_zeros.shp"
where_clause = '"\"Shape_Length\" = 0''

# Execute Select
arcpy.Select_analysis(in_features, out_feature_class, where_clause)
&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;What I expected -&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;in the shapefile linefile_zeros would be all the line features with a zero line length.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;What I get -&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;The original file "linefile" now contains all of the zero length lines and linefile_zero now contains all of the features (zero's and greater)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Is this working as intended?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 May 2012 15:22:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/select-analysis/m-p/117827#M9247</guid>
      <dc:creator>ScottBlankenbeckler</dc:creator>
      <dc:date>2012-05-23T15:22:42Z</dc:date>
    </item>
    <item>
      <title>Re: Select_analysis</title>
      <link>https://community.esri.com/t5/python-questions/select-analysis/m-p/117828#M9248</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;You have a few issues, not sure if they are related to the problem you are having or some mistake in copying your code. Your where_clause has a syntax error and your in_features variable should be raw stringed or you should be setting your workspace to the FGDB.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Something like this&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;import arcpy
# Set local variables
arcpy.env.workspace = ws = r"..\working.gdb"
in_features = "linefile"
out_feature_class = "C:/output/linefile_zeros.shp"
query_field = "Shape_Length"
field_delim = arcpy.AddFieldDelimiters(ws,query_field)
where_clause = "{0} = 0".format(field_delim)

# Execute Select
arcpy.Select_analysis(in_features, out_feature_class, where_clause)&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 06:54:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/select-analysis/m-p/117828#M9248</guid>
      <dc:creator>MathewCoyle</dc:creator>
      <dc:date>2021-12-11T06:54:54Z</dc:date>
    </item>
    <item>
      <title>Re: Select_analysis</title>
      <link>https://community.esri.com/t5/python-questions/select-analysis/m-p/117829#M9249</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;You have a few issues, not sure if they are related to the problem you are having or some mistake in copying your code. Your where_clause has a syntax error and your in_features variable should be raw stringed or you should be setting your workspace to the FGDB.&lt;BR /&gt;&lt;BR /&gt;Something like this&lt;BR /&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Actually my issues have nothing to do with what you stated as it reads my in_features correctly and my where_clause works fine as well.&amp;nbsp; If you read my issues it has to do with the output and output only. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;The results of my code is the Input file becomes what is expected in the Output and the Output becomes a copy of the Original Input.&amp;nbsp; &lt;/STRONG&gt;&lt;SPAN&gt;This and only this is the issue I am trying to get resolved.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;If my where_clause was wrong the output file would give me different results but the Input file now has the results that I expected in the Output (as per my where_clause).&amp;nbsp; Also if my input was wrong I would get an error as there would be nothing to read.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Example:&lt;/SPAN&gt;&lt;BR /&gt;&lt;STRONG&gt;Input (linefile)&lt;BR /&gt;&lt;/STRONG&gt;&lt;SPAN&gt;Name, Shape_length&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;A, 1.508&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;B, 0&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;C, 2.134&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;Ouput&lt;/STRONG&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;STRONG&gt;(linefile_zeros.shp)&lt;BR /&gt;&lt;/STRONG&gt;&lt;SPAN&gt;Name, Shape_length&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;A, 1.508&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;B, 0&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;C, 2.134&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;(linefile)&lt;BR /&gt;&lt;/STRONG&gt;&lt;SPAN&gt;Name, Shape_length&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;B, 0&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 May 2012 17:01:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/select-analysis/m-p/117829#M9249</guid>
      <dc:creator>ScottBlankenbeckler</dc:creator>
      <dc:date>2012-05-23T17:01:37Z</dc:date>
    </item>
    <item>
      <title>Re: Select_analysis</title>
      <link>https://community.esri.com/t5/python-questions/select-analysis/m-p/117830#M9250</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I was just trying to work from the ground up to see what the issue might be. It is difficult to troubleshoot without the actual code you are executing. Have you tried creating a feature layer of your input feature class and running the select tool on that layer instead? Also, what version of ArcGIS are you using?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 May 2012 17:11:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/select-analysis/m-p/117830#M9250</guid>
      <dc:creator>MathewCoyle</dc:creator>
      <dc:date>2012-05-23T17:11:18Z</dc:date>
    </item>
    <item>
      <title>Re: Select_analysis</title>
      <link>https://community.esri.com/t5/python-questions/select-analysis/m-p/117831#M9251</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;If it makes it easier for you to understand this is the line of code as it rest in my script&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; # Process: Select
&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.Select_analysis(IN_line, OUT_zero, "\"Shape_Length\" = 0")&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I just thought I would be nice and put what formats of input and output were expected. This is important when building the where clause as the format of the field would be different based on the format of the input storage.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am running ArcMap 10.1 pre-release. I am posting here because I have never used this function in a script and was not sure if this was the typical output for this function.&amp;nbsp; I was hoping someone using 10.0 or earlier would say "Yes it has always been that way.", or "No it shouldn't.", or even "I works correctly in my code."&amp;nbsp; At that point I would know how to proceed, either with a bug report of change my code so it uses the data as outputted.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 06:54:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/select-analysis/m-p/117831#M9251</guid>
      <dc:creator>ScottBlankenbeckler</dc:creator>
      <dc:date>2021-12-11T06:54:57Z</dc:date>
    </item>
    <item>
      <title>Re: Select_analysis</title>
      <link>https://community.esri.com/t5/python-questions/select-analysis/m-p/117832#M9252</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;It is definitely not how the tool works in 10.0. I'd suspect some kind of bug.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 May 2012 17:39:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/select-analysis/m-p/117832#M9252</guid>
      <dc:creator>MathewCoyle</dc:creator>
      <dc:date>2012-05-23T17:39:26Z</dc:date>
    </item>
  </channel>
</rss>

