title: Read only 2 columns from a '~' delimited text file into dataframe and store second column as string
body: <p>I have a very large text file (3.33 GB) which has 47 columns separated by delimiter <code>~</code>. I just need the first and the last column to work with. The last column is a 17 digit number which may contain leading zeros. I have to store this column as a string (so as to not remove the leading zeros). An example of the first and last column is shown below:</p>
  
  <pre class="lang-py prettyprint-override"><code>   id   Number
  0   0   10030040125198660
  1 12345 60034046122158670
  </code></pre>
  
  <p>My question is whether it's possible to read just these two columns alone, and store the second column as string ? The reason I ask is because loading 3.3GB file as a dataframe takes a lot of time, converting it into string takes an even longer amount. I want to know if I can save time by choosing only the columns I need.</p>
  
  <p>My code as of now (shown the column names as numbers for easy understanding):</p>
  
  <pre class="lang-py prettyprint-override"><code>df=pd.read_csv('myfile.txt',low_memory=False,sep='~',header=None)
  df.drop(columns=[2,3,4...,46],inplace=True)                       #Keeping only column 1 and 47
  df['47']=df['47'].astype(str)
  </code></pre>
  
  <p>Any help is highly appreciated!</p>