A Real Python Optimization You Can Use

preview_player
Показать описание
A real Python optimization you can use. #python #code #shorts
Рекомендации по теме
Комментарии
Автор

You ran the set operation only 100 times.

icantfindausernamess
Автор

I think it's a reason why even python developers should to learn data structures.

АлександрКоновалов-шн
Автор

I have also tried with a tuple, and is as slow as a list.
Why?
Shouldn't tuples be faster because they are immutable?

juanete
Автор

Please could you also add comparison with numpy array of bool when arr[i] gives the information if i is present or not in the array? Something like arr = bool).

ondrej.ivancik
Автор

And use frozenset when you want an immutable set.

vorpal
Автор

But sets are unordered, unlike lists, then how's this possible

shubhamthanki
Автор

Lists and sers of 100_000 are unlikely. Will probably be a Numpy array in real life.

OL
Автор

bro do you even check you videos before uploading them?

jkf
Автор

This has nothing to do with python though. It has to do with knowing which data structure one needs to choose/use depending on usage

tratbagd