Descargar el Código: patreon.com/pythonmaraton
Join Patreon: patreon.com/pythonmaraton
^Downloadable code & more! np.save
Here we have a 10x10 random array I created called A.
Let’s say you have a giant array, like the A we have here, that you want to send to a friend or save as data for later.
numpy’s np.save will allow you to do this.
So before we do anything we can look at the documentation. We need a file name and the array as inputs. There are also two more parameters called allow_pickle and fix_imports which you would only be interested in changing if you are worried about security or need to export in a format that is compatible with certain functions in python’s older version Python 2.
But for us it will be as simple as giving a file name and the array to np.save. So we type np.save(“sample.npy”, A) the dot npy the standard extension for numpy arrays when they are saved as files.
I saved this on my desktop so let’s see if it is there.
Excellent just like we wanted.
There you have it that is how you can save your numpy arrays using np.save.
In my next video I will show you how to load a saved array into your code.
Please checkout some of my other python videos and don’t forget to hit subscribe. :D
This is a Python anaconda tutorial for help with coding, programming, or computer science. These are short python videos dedicated to troubleshooting python problems and learning Python syntax. For more videos see Python Help playlist by Rylan Fowers.
✅Subscribe: https://www.youtube.com/channel/UCub4...
📺Channel: https://www.youtube.com/channel/UCub4...
▶️Watch Latest Python Content: https://www.youtube.com/watch?v=myCPg...
▶️Watch Latest Other Content: https://www.youtube.com/watch?v=2YfQs...
🎵Theme Music: https://www.bensound.com/royalty-free...
#PythonMarathon #LearnPython #PythonTutorial