0

I would like to save the txt file directly to a ftp location instead of localmachine. I have found a similar problem here, but I would like to use numpy.savetxt()

Thank you!

Harsha
  • 353
  • 1
  • 15
  • Why don't you want to use FTPlib? I don't think it's possible with only `savetxt` but if you insist using numpy, numpy has DataSource function that can read files from remote that you can try: https://www.w3resource.com/numpy/input-and-output/datasource.php – TYZ Apr 28 '20 at 15:09
  • @tyz I can use FTPlib, I'm not sure how to use this library with savetxt – Harsha Apr 28 '20 at 15:18
  • `savetxt` works with an opened file, so presumably will work with anything that has an `write` method. `savetxt` is written in python, so you can read the code, and adapt it as needed. Basically it iterates on the array rows, formats them and writes them. – hpaulj Apr 28 '20 at 15:39

0 Answers0