 Okay, guys, so today I'm going to show you this awesome library called Numba. Numba fixes the problem of having very simple operations in Python take a very long time to do. So, for example, this is a function I wrote as an example. All it does is it iterates over x, y, and z, and then does some conditional check, and then it appends to the list l, some value if that conditional check ends up being true. Now, it's going to take me a long time to execute this, so I'm going to really show you, like, what the problem is here. So, if I run this script, you can see that it's taking forever to execute something that should relatively not be so long. Like, it should not take Python this long to execute something so simple, but it does. So, as you can see here, it took 12 seconds to iterate over these three loops. Now, that's unacceptable, and I think that a lot of people who write Python code also agree with me because there's a library called Numba that really helps you out in these situations. So, what Numba does is it takes a function and it compiles that function for you so that when you execute it, it's a lot faster than it would be if it wasn't compiled. Now, to show you how that works, I'm just going to import from Numba. I am going to import ngit. And ngit is a decorator that you are supposed to stick on top of functions that you want to optimize. So, for example, if I want to ngit this f function, all I'm doing is I'm going to add ngit on top of this function. And when I run this, it is going to be a lot faster than it used to be. So, as you can see, even though it's still one second, I mean, it's not perfect, but it's a lot better than 12 seconds. Like, something like this executing in one second is much better than a 12-second execution. But there are problems with ngit too, so it's not really for free. You do have to keep in mind that you can't do a lot of things that you could do in regular functions if you use ngit. So, one of the limitations is that if you use ngit, you are not allowed to use a lot of functions that you would otherwise be allowed to use. So, for example, if you are using a dependency, if you're using some library that ngit doesn't really know about, you may have problems if you add functions from that library into this function. And another thing that you really need to keep in mind when you're looking at optimizing your functions with ngit is that if you have a low execution, if you don't have a lot of executions in your functions, so, for example, if I reduce all of my ranges from like 100,000 to 101010, if I execute this, if I execute this, you'll see that it's going to take me 0.27 seconds to execute and you may be asking me, well, what's the big deal? Well, the big deal is that if I remove ngit up here and I execute the same function, you'll see that it's going to take me 0 seconds. So, in this case, Python is actually faster than ngit is. And the reason for that is because when you compile a function, it takes time to compile it. So, the first time that function runs, it's going to take it a very long time to compile. But you can also reduce the execution time here by doing this. So, if I do ngit, and let's say I don't care about the first time that I run this function. So, the first time, I don't care about timing, first time running. Okay, so I don't care about the timing, first time running. So, the first time I execute this function, it's going to get compiled and it's going to run. But the second time I execute this, it's already compiled. So, it's not going to recompile. So, the timing is going to be much faster. So, if I run this again, we'll see that the timing is actually, the timing of the function itself is actually pretty quick. But it's pretty quick because the compilation already happened, right? So, the time needed to compile this function already happened up here. And because of that, this function down here is a lot faster at executing. Now, here's another thing. If you are doing a loop and you're executing this function down here in a loop, so let's say for x in range. I'm going to execute this, let's see, 1,000 times, I would say, or 10,000 times. So, I'm going to execute this 10,000 times. And we'll see that if I run this, we are running this in half a second. Or about half a second. But if I remove the engine and we run this, yeah, it's going to take a long longer. So, it took almost three times longer to execute without engine than it did with engine. So, yeah, it's really interesting to try to optimize your Python scripts using engine because engine is one of those things that you don't really need to remember a lot. All you need to do is remember engine. Now, you do have other things with number. So, for example, you have parallelization. You can do parallelization with number. But I don't really want to touch that because the more you get into the weeds with optimization, the more time you're wasting just optimizing your code instead of getting things done. So, for example, for me, if I can get my script to run in a couple of seconds, that's good enough. I don't need to have a script that runs sub a second or sub millisecond. I don't care about that. So, all I use at number four is the engine. And I recommend everyone installs number and uses engine just in cases like this where you need to optimize a fairly simple function.