Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- df = pd.read_csv(...)
- def read_file_sftp_local_memory(sftp, path, filename):
- flo = BytesIO()
- path_query = "".join(['RETR ', path, '/', filename])
- sftp.retrbinary(path_query, flo.write)
- flo.seek(0)
- return flo
- def read_file_csv(sftp, path, filename):
- # Download
- sftp.get("/".join( os.path.join(path, filename) ), filename)
- # Read
- df = pd.read_csv(filename)
- # Delete
- os.remove(filename)
- # Return
- return df
- raise IOError(text)
- OSError: Failure
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement