title: Python Pandas -- Concatenate strings if condition
body: <p>In a <code>pd.DataFrame</code> I have strings in column <code>A</code> whose <code>len</code> is equal to 5 or 6.  If the cell value <code>len(value) == 5</code> then I need to concatenate the string <code>'7'</code>  to the beginning of the cell value.  I am currently trying the code below, but cannot seem to use apply with the <code>inplace=True</code> argument.</p>
  
  <pre><code> df[df['A'].str.len() == 5]['A'].apply(lambda x: '7' + str(x))
  </code></pre>
  
  <p>this will return the column - but won't modify the dataframe inplace...</p>