<?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: Invalid Expression Error in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/invalid-expression-error/m-p/27228#M2057</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Post your exact code you executed and the error you received. Are you trying to do with through a script tool, python window, stand alone script?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 09 Jan 2013 17:29:38 GMT</pubDate>
    <dc:creator>MathewCoyle</dc:creator>
    <dc:date>2013-01-09T17:29:38Z</dc:date>
    <item>
      <title>Invalid Expression Error</title>
      <link>https://community.esri.com/t5/python-questions/invalid-expression-error/m-p/27225#M2054</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I am trying to write a script that runs a select by location then a subset selection of select by attribute but I keep getting an invalid expression error. The last where clause is to selected any blank fields in the STD_CND field.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;arcpy.SelectLayerByLocation_management("Culvert_subset", "INTERSECT", "Cont_Buff")&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;arcpy.SelectLayerByAttribute_management("Culvert_subset","SUBSET_SELECTION",'"STD_CND" = poor' or '"STD_CND = Very Poor' or '"STD_CND" = ""')&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Additionally once this selection is made will it continue (or be saved) through the rest of the script or should I create a new shapefile from it?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any thoughts? &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Jan 2013 16:46:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/invalid-expression-error/m-p/27225#M2054</guid>
      <dc:creator>EmilyAgar1</dc:creator>
      <dc:date>2013-01-09T16:46:19Z</dc:date>
    </item>
    <item>
      <title>Re: Invalid Expression Error</title>
      <link>https://community.esri.com/t5/python-questions/invalid-expression-error/m-p/27226#M2055</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;This is not a valid query.&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code jive_text_macro"&gt;'"STD_CND" = poor' or '"STD_CND = Very Poor' or '"STD_CND" = ""'&lt;/PRE&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm not sure of your data schema but something like this might work.&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code jive_text_macro"&gt;'''"STD_CND" in ('poor', 'Very poor', '')'''&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Jan 2013 16:50:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/invalid-expression-error/m-p/27226#M2055</guid>
      <dc:creator>MathewCoyle</dc:creator>
      <dc:date>2013-01-09T16:50:26Z</dc:date>
    </item>
    <item>
      <title>Re: Invalid Expression Error</title>
      <link>https://community.esri.com/t5/python-questions/invalid-expression-error/m-p/27227#M2056</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I tried those changes and got an invalid syntax error. STD_CND is a field within the Culvert_subset layer in which I am wanting to select all the culverts with a rating of poor, very poor or no rating&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Jan 2013 17:01:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/invalid-expression-error/m-p/27227#M2056</guid>
      <dc:creator>EmilyAgar1</dc:creator>
      <dc:date>2013-01-09T17:01:51Z</dc:date>
    </item>
    <item>
      <title>Re: Invalid Expression Error</title>
      <link>https://community.esri.com/t5/python-questions/invalid-expression-error/m-p/27228#M2057</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Post your exact code you executed and the error you received. Are you trying to do with through a script tool, python window, stand alone script?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Jan 2013 17:29:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/invalid-expression-error/m-p/27228#M2057</guid>
      <dc:creator>MathewCoyle</dc:creator>
      <dc:date>2013-01-09T17:29:38Z</dc:date>
    </item>
    <item>
      <title>Re: Invalid Expression Error</title>
      <link>https://community.esri.com/t5/python-questions/invalid-expression-error/m-p/27229#M2058</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I am just trying it in the python window right now, but it will be a piece to a tool that I am working on.&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
import arcpy
arcpy.env.workspace = "W:\ENG\Geomatics\PROJECT\Python Script"
 
arcpy.Buffer_analysis("5yrContract_subset", "Cont_Buff", "50 METERS", "FULL", "FLAT", "NONE")

arcpy.SelectLayerByLocation_management("Culvert_subset", "INTERSECT", "Cont_Buff")
arcpy.SelectLayerByAttribute_management("Culvert_subset","SUBSET_SELECTION", '''"STD_CND" in ('poor', 'Very Poor' '')'''
 
Parsing error &amp;lt;type 'exceptions.SyntaxError'&amp;gt;: invalid syntax (line 8)&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Dec 2021 21:06:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/invalid-expression-error/m-p/27229#M2058</guid>
      <dc:creator>EmilyAgar1</dc:creator>
      <dc:date>2021-12-10T21:06:22Z</dc:date>
    </item>
    <item>
      <title>Re: Invalid Expression Error</title>
      <link>https://community.esri.com/t5/python-questions/invalid-expression-error/m-p/27230#M2059</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;You need a closing bracket and the last comma.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code jive_text_macro"&gt;arcpy.SelectLayerByAttribute_management("Culvert_subset", "SUBSET_SELECTION", '''"STD_CND" in ('poor', 'Very Poor', '')''')&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Jan 2013 18:42:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/invalid-expression-error/m-p/27230#M2059</guid>
      <dc:creator>MathewCoyle</dc:creator>
      <dc:date>2013-01-09T18:42:03Z</dc:date>
    </item>
  </channel>
</rss>

