↓ Skip to main content

Data Science

NumPy broadcasting and vector quantization

NumPy broadcasting and vector quantization

·3913 words·19 mins
We learn in math that there are rules for adding or multiplying matrices. But in computational math problems we sometimes have matrices or vectors that we would like to add or multiply and that do not meet the requirements. In this article we will see how the NumPy broadcasting concept is useful in these contexts and how it relates to vector quantization.
So, What Is NumPy's reshape?

So, What Is NumPy's reshape?

·2409 words·12 mins
If you are venturing into data science, you have most likely seen a reshape in some code. Maybe with a mysterious value of -1 in one of the positions, as in reshape(-1, 1). But what does that mean? Why do we sometimes need to transform our data to use model methods in Scikit-Learn? That is what we will see in this article.