Python Tutorial - Python Numpy Allclose

Publicado em: 06 Setembro 2018
no 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


Nesta página do site você pode assistir ao vídeo on-line Python Tutorial - Python Numpy Allclose duração hora minuto segundo em boa qualidade , que foi baixado pelo usuário Python Marathon 06 Setembro 2018, compartilhe o link com seus amigos e conhecidos, no youtube este vídeo já foi visto 1,979 vezes e gostou 23 espectadores. Boa visualização!