MACHINE LEARNING RECIPES
DATA CLEANING PYTHON
DATA MUNGING
PANDAS CHEATSHEET
ALL TAGS
# How to find common values between two arrays?

# How to find common values between two arrays?

This recipe helps you find common values between two arrays

Many times we are dealing with mulitple arrays. Sometimes there is need of finding the intersection between two for working on common elements further.

So this recipe is a short example on how to find common values between two arrays. Let's get started.

```
import numpy as np
```

Let's pause and look at these imports. Numpy is generally used for working with arrays and performing mathematical operations in domain of linear algebra, fourier transform and matrices.

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

We have simply setup two random arrays.

```
print(np.intersect1d(x, y))
```

intersect1d basically helps in finding common elements of 1-D array.

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

[0 2 4]

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 project, we are going to work on Deep Learning using H2O to predict Census income.

In this R data science project, we will explore wine dataset to assess red wine quality. The objective of this data science project is to explore which chemical properties will influence the quality of red wines.

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.

In this machine learning churn project, we implement a churn prediction model in python using ensemble techniques.

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.

In this machine learning resume parser example we use the popular Spacy NLP python library for OCR and text classification.

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 NLP AI application, we build the core conversational engine for a chatbot. We use the popular NLTK text classification library to achieve this.

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