I have a CSV file on an FTP server. The file is around 200mb.
For now, I am reading the file using the following method, the issue with this implementation is that the file takes too long to download, the retrbinary
method takes around 12min to execute. I tried with different block sizes, I was able to get the time to 11 min which is still too much.
download_file = io.BytesIO()
ftp.retrbinary("RETR {}".format(file_path),download_file.write, 8024)
download_file.seek(0)
dataframe = pandas.read_csv(download_file, nrows=4)
I need help reading the file in chunks, I only need the first 4 rows of the file.