Python Tutorial - Python Numpy Allclose

Publicado el: 06 septiembre 2018
en el canal de: Python Marathon
1,979
23

Descargar el Código: patreon.com/pythonmaraton

Join Patreon: patreon.com/pythonmaraton
^Downloadable code & more! This will show you how to use np.allclose, which can help coders test their output.

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:    / @pythonmaraton  

📺Channel:    / @pythonmaraton  

▶️Watch Latest Python Content:    • Python String Slice and List Slice  

▶️Watch Latest Other Content:    • Video  





NP ALL CLOSE

Let me show you a great way to compare and test outputs and code

I like to use np.allclose

In Ipython we can see some of the parameters of this function

It takes in two things to compare, and you can set different tolerances. Also there is a parameter for how you want to deal with NAN or not a numbers

So for an example these will obviously return false because they are different

But let’s do something a bit harder. We will do 1 and a bunch of .9999s. This will return True since your computer cannot tell the difference, but we won’t get into details of why that is here.

So there you have it, that is how you use np.allclose in python

The creator studies Applied and Computational Mathematics at BYU (BYU ACME program)

#PythonMarathon #LearnPython #PythonTutorial


En esta página del sitio puede ver el video en línea Python Tutorial - Python Numpy Allclose de Duración hora minuto segunda en buena calidad , que subió el usuario Python Marathon 06 septiembre 2018, comparta el enlace con amigos y conocidos, en youtube este video ya ha sido visto 1,979 veces y le gustó 23 a los espectadores. Disfruta viendo!