Search
 
SCRIPT & CODE EXAMPLE
 

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)
Comment

PREVIOUS NEXT
Code Example
Python :: how to add a fuction in python 
Python :: legend matplotlib 
Python :: decimal to binary in python 
Python :: user defined functions python 
Python :: change dataframe to list 
Python :: same elements of two sets in python 
Python :: python read binary trj file 
Python :: pandas merge df 
Python :: php echo shorthand 
Python :: python find file name 
Python :: python array methods 
Python :: str replace python regex 
Python :: how to define piecewise function i python 
Python :: check is string is nan python 
Python :: get turtle pos 
Python :: get column index of maximum value in each row pandas 
Python :: get last 3 elements in a list python 
Python :: scatter matrix plot 
Python :: python dunder 
Python :: python loop through dictionary 
Python :: python get substring between strings 
Python :: use django taggit in template 
Python :: python array slice 
Python :: python pd.Timestamp add days 
Python :: draw box with mouse on image in canvas tkinter 
Python :: adding text cv2 
Python :: hostname python 
Python :: python autocorrelation plot 
Python :: Groups the DataFrame using the specified columns 
Python :: python try except continue loop 
ADD CONTENT
Topic
Content
Source link
Name
6+4 =