title: Adding 0 in front of date
body: <p>New to programming:
  I have a CSV file in which date is given in format <code>DDMMYYYY</code>, while reading the file in python its type is  taken as <code>int</code>. So a date say <code>01022020</code> is being taken as <code>1022020</code>. I need to add the <code>0</code> in front of all these dates wherein dates' <code>len</code> is less than <code>8</code>.</p>
  <pre><code>Index           Date              Value
  0             10042020            10.5
  1             03052020            14.2
  2             09052020            16.3
  3             13052020            17.5
  </code></pre>
  <p>I converted the column to <code>str</code> using <code>df.Date.map(str)</code> but can't understand how to proceed.</p>
  <p>I tried:</p>
  <pre><code>if len(df.Date[i])==7:
          df.Date[i]= df.Date.str[&quot;0&quot;]+df.Date.str[i]
  </code></pre>
  <p>Its not working. I have two queries regarding this:</p>
  <ol>
  <li><p>want to understand why is this wrong logically and what's the best solution.</p>
  </li>
  <li><p>While reading the data from CSV file, can a column having integers only be converted to string directly?</p>
  </li>
  </ol>
  <p>Please help.</p>