Why you should use NumPy vs FOR loops in Python

preview_player
Показать описание
Numpy is hella quick

Oh, and don't forget to connect with me!

Happy coding!
Nick

P.s. Let me know how you go and drop a comment if you need a hand!
#numpy #datascience
Рекомендации по теме
Комментарии
Автор

There is thumb rule according to me: If you are using lists use python methods or if you are using ndarray use numpy methods

prasadsawant
Автор

good video, and thanks for giving a brief explanation on why NumPy is so much faster instead of just giving an example and saying "boom it's fast so go use it"

casualbeluga
Автор

the better way to solve this problem is to notice that each element in a will appear in the answer exactly len(b) times and each element in b will appear in the answer exactly len(a) times
so the following code:
ans = sum(a) * len(b) + sum(b) * len(a)
will lead to the same answer and will run in O(N + M) which blows out of the park numpy bruteforce

EnDeRBeaT
Автор

Your content is very good Nicholas. Keep it up!

dinovillani
Автор

Interesting. But for most use cases that's unnecessary. For web for example you really don't need those extra nanoseconds shaved off (clarity and maintainability > speed), unless you're actually dealing with heavy calculations

shimadabr
Автор

Can u give a tutorial on Numpy module, Boolean Indexing and all in Numpy

truepatriot
Автор

any suggestions on how to study numpy? Thank you for you video : )

grandsonofstar
Автор

hey buddy, it would be really helpful if you can make a recommendation system

shivaog
Автор

Numpy is absolute monster, but did you experiment this with JAX? JAX is 22 times faster than numpy in average, check it out :D love your videos btw 💪

benhmidanizar
Автор

But numpy arrays can't be heterogeneous

arpitgaur
Автор

How about you just use math. This sort of neglect for common sense causes bloated ass slow software

iygpbzf