Python Tutorial - Python Numpy Allclose

Опубликовано: 06 Сентябрь 2018
на канале: 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


На этой странице сайта вы можете посмотреть видео онлайн Python Tutorial - Python Numpy Allclose длительностью часов минут секунд в хорошем качестве, которое загрузил пользователь Python Marathon 06 Сентябрь 2018, поделитесь ссылкой с друзьями и знакомыми, на youtube это видео уже посмотрели 1,979 раз и оно понравилось 23 зрителям. Приятного просмотра!