Python Numpy Random Array

Publicado em: 29 Agosto 2018
no canal de: Python Marathon
5,869
36

Descargar el Código: patreon.com/pythonmaraton

Join Patreon: patreon.com/pythonmaraton
^Downloadable code & more! Generally, for an array with random values in the range [a,b] you have (b-a)*np.random.random(())+a.

This video shows you how to use np.random.random(()) to create random arrays of size n with entries between any numbers you desire.

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  





RANDOM ARRAY

In this video let me show you some examples of how to create random matrices in python.

We import numpy as np and random

First just type np.random.ranom and then enter a tuple with the size of the disred random matrix. It will automatically create a matrix with entries between 1 and 0

If we want to change the value range, we can multiply by twice the value desired and then subtract the value desired from the end

So if we want entries between -5 and 5 we multiply by 10 and minus 5.

So if you think about it this way, the max number it could be is 10 - 5 = 5 and the min number it could be is 0 - 5 = -5

So if we want entries between -100 and 100 we multiply by 200 and minus 100.

So if you think about it this way, the max number it could be is 200 - 100 = 100 and the min number it could be is 0 - 100 = -100

There you have it, that is how you create random arrays in python

#PythonMarathon #LearnPython #PythonTutorial


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