Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

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)
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #dataframe #ftp
ADD COMMENT
Topic
Name
5+9 =