title: Reading CSV file downloaded from FTP in Python not reading all rows
body: <p>I am trying to read a CSV file from a folder in FTP. The file has 3072 rows. However, when I am running the code, it is not reading all the rows. Certain rows from the bottom are getting missed out.</p>
  <pre><code>## FTP host name and credentials
  ftp = ftplib.FTP('IP', 'username','password')
  
  ## Go to the required directory
  ftp.cwd(&quot;Folder_Name&quot;)
  
  names = ftp.nlst()
  final_names= [line for line in names if '.csv' in line]
  
  latest_time = None
  latest_name = None
  
  #os.chdir(filepath)
  
  for name in final_names:
      
      time1 = ftp.sendcmd(&quot;MDTM &quot; + name)
      if (latest_time is None) or (time1 &gt; latest_time):
          latest_name = name
          latest_time = time1
  
  file = open(latest_name, 'wb')
  
  ftp.retrbinary('RETR '+ latest_name, file.write)
  
  dat = pd.read_csv(latest_name)
  </code></pre>
  <p>The CSV file to be read from FTP is as given below-</p>
  <p><a href="https://i.stack.imgur.com/c4MBc.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/c4MBc.png" alt="enter image description here" /></a></p>
  <p>The output from the code is as-</p>
  <p><a href="https://i.stack.imgur.com/bGhmg.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/bGhmg.png" alt="enter image description here" /></a></p>