title: How to I export data with leading zeros from Pandas to CSV preserving the leading zeros in csv
body: <p>I have a pandas data frame in which one column contains data with leading zeros.I want to export the data frame in CSV by preserving leading zeros. So I tried following code</p>
  
  <pre><code>import numpy as np
  import pandas as pd
  import os
  os.chdir(path)
  x=np.array(['0134','0567','0012','0009'])
  
  df=pd.DataFrame(x,columns=['Test'])
  df.dtypes
  df.Test=df.Test.astype("str")
  df.to_csv("leadingZero.csv")
  </code></pre>
  
  <p>But in leadingZero.csv I'm finding 0's in one column &amp; number discarded zeros in another column</p>
  
  <p>Can you guide me how do I preserve leading zeros in CSV?</p>