Created
July 26, 2017 10:18
-
-
Save MaxHalford/f17994c77bb775fdd04c9cd925e0b279 to your computer and use it in GitHub Desktop.
Save a pandas.DataFrame to Dropbox
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import dropbox | |
def to_dropbox(dataframe, path, token): | |
dbx = dropbox.Dropbox(token) | |
df_string = dataframe.to_csv(index=False) | |
db_bytes = bytes(df_string, 'utf8') | |
dbx.files_upload( | |
f=db_bytes, | |
path=path, | |
mode=dropbox.files.WriteMode.overwrite | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment