Answers for "dataframe to ftp"

0

dataframe to ftp

from ftplib import *
from io import StringIO
import pandas
import io

ftp = FTP('ftp.mysite.com')
ftp.login('un', 'pw')
ftp.cwd('/')
buffer = StringIO.StringIO()
your_pandas_df.to_csv(buffer)
text = buffer.getvalue()
bio = io.BytesIO(str.encode(text))

ftp.storbinary('STOR filename.csv', bio)
Posted by: Guest on July-06-2020

Python Answers by Framework

Browse Popular Code Answers by Language