title: How to search and find a syntax error and then correct the syntax by adding to the string?
body: <p>If the string in a row is missing the syntax or have uncorrect syntax, i would like to locate that row and edit/correct that syntax for sorting purposes.</p>
  
  <p>What i've come up with so far:</p>
  
  <pre><code>df.loc[~df['Syntax'].str.contains('x')] = '1x'+ df['Syntax'].astype(str)
  </code></pre>
  
  <p>provides the error:</p>
  
  <pre><code>ValueError: Must have equal len keys and value when setting with an iterable
  
  
  df = pd.read_excel('raw_data')
  
  df.loc[~df['Syntax'].str.contains('x')] = '1x'+ df['Syntax'].astype(str)
  
  df.sort_values('Syntax', inplace = True)
  
  print (df)
  </code></pre>
  
  <p>Item 3 is the typical syntax error:</p>
  
  <pre><code>Item    Syntax  Date
  1   1x12    5/14/2019
  2   4x16    5/14/2019
  3   32  5/14/2019
  4   3x10    5/14/2019
  </code></pre>
  
  <p>And what i want is to find those with number only and add "1x" in front of it. Output would look like:</p>
  
  <pre><code>Item    Syntax  Date
  1   1x12    5/14/2019
  2   4x16    5/14/2019
  3   1x32    5/14/2019
  4   3x10    5/14/2019
  </code></pre>