NumPy

NumPy's methods are already highly optimized for performance. Yer, here's how you can further speed them up. Bottleneck provides a suite of optimized…
Pandas assumes that the data is a sample of the population and that the obtained result can be biased towards the sample. Thus, to generate an unbiased…
While creating conditional columns in Pandas, we tend to use the 𝐚𝐩𝐩𝐥𝐲() method almost all the time. However, 𝐚𝐩𝐩𝐥𝐲() in Pandas is nothing but…
Numpy already offers fast and optimized vectorized operations. Yet, it does not support parallelism. This provides further scope for improving the…
Matrix multiplication is a common operation in machine learning. Yet, chaining repeated multiplications using 𝐦𝐚𝐭𝐦𝐮𝐥 function makes the code…
The 𝐧𝐩.𝐦𝐚𝐭𝐦𝐮𝐥() and 𝐧𝐩.𝐝𝐨𝐭() methods produce the same output for 2D (and 1D) arrays. This makes many believe that they are the same and can…
We often print raw numpy arrays during debugging. But this approach is not very useful. This is because printing does not convey much information about…
While creating conditional columns in Pandas, we tend to use the 𝐚𝐩𝐩𝐥𝐲() method almost all the time. However, 𝐚𝐩𝐩𝐥𝐲() in Pandas is nothing but…
Polynomial linear regression using Sklearn is tedious as one has to explicitly code its features. This can get challenging when one has to iteratively…