MACHINE LEARNING RECIPES
DATA CLEANING PYTHON
DATA MUNGING
PANDAS CHEATSHEET
ALL TAGS
# What does broadcasting mean with respect to numpy?

# What does broadcasting mean with respect to numpy?

This recipe explains what does broadcasting mean with respect to numpy

Broadcasting refers to how numpy treats arrays having different size while working with operators. The smaller array is generally broadcasted across the larger array.

So this recipe is a short example on what does broadcasting mean with respect to numpy. Let's get started.

```
import numpy as np
```

Let's pause and look at these imports. Pandas is generally used for performing mathematical operation and preferably over arrays.

```
x=np.array([[1,2,3],[4,5,6]])
y=np.array([1,2,3])
```

Let us create a two simple simple arrays of size 2x3 and 1x3.

```
z=x+y
```

X and y are of different size. Performing any mathematical operation over them is considered as broadcasting. Here, the values of y get added to value of x depending upon its position.

```
print(z)
```

Simply use print function to print z

Once we run the above code snippet, we will see:

[[2 4 6] [5 7 9]]

Data Science Project in Python- Given his or her job role, predict employee access needs using amazon employee database.

Machine Learning Project - Work with KKBOX's Music Recommendation System dataset to build the best music recommendation engine.

In this data science project in R, we are going to talk about subjective segmentation which is a clustering technique to find out product bundles in sales data.

Data Science Project in R-Predict the sales for each department using historical markdown data from the Walmart dataset containing data of 45 Walmart stores.

In this deep learning project, we will predict customer churn using Artificial Neural Networks and learn how to model an ANN in R with the keras deep learning package.

Data Science Project - Build a recommendation engine which will predict the products to be purchased by an Instacart consumer again.

The goal of this data science project is to build a predictive model and find out the sales of each product at a given Big Mart store.

In this machine learning pricing project, we implement a retail price optimization algorithm using regression trees. This is one of the first steps to building a dynamic pricing model.

PySpark Project-Get a handle on using Python with Spark through this hands-on data processing spark python tutorial.

In this Kmeans clustering machine learning project, you will perform topic modelling in order to group customer reviews based on recurring patterns.