title: How to replace only single numbers with another number in a pandas dataframe?
body: <p>I have the following pandas dataframe:</p>
  
  <pre><code>   date
  0   1
  1   2
  2   23
  3   31
  4   4
  ...
  n    3
  </code></pre>
  
  <p>How can I <strong>only</strong> replace all the numbers from 1 to 9 (e.g. <strong>numbers with one digit</strong>) with the following format:</p>
  
  <pre><code>01, 02, 03, 04, 05, 06, 07, 08, 09
  </code></pre>
  
  <p>I tried to do with pandas replace function the following:</p>
  
  <pre><code>df['date'] = df['date'].replace(['1', '2', '3', '4', '5', '6', '7', '8', '9']),
                                                            [' 01 ', ' 02 ', ' 03 ', '04 ', ' 05 ', ' 06 ', ' 07 ', ' 08 ', ' 09 '],regex=True)
  </code></pre>
  
  <p>However, it didn't worked because it is modifying <strong>all</strong> (i.e. numbers with more than one digit) the numbers inside the dataframe. Thus, how can I normalize the date column?.</p>