DATA MUNGING
DATA CLEANING PYTHON
MACHINE LEARNING RECIPES
PANDAS CHEATSHEET
ALL TAGS
# How to reshape a Numpy array in Python?

# How to reshape a Numpy array in Python?

This recipe helps you reshape a Numpy array in Python

Have you ever tried to reshape a numpy array? Creating a new array to reshape it might be a hectic task. So how we can do it very easily in python.

So this is the recipe on how we can Reshape a Numpy Array.

```
import numpy as np
```

We have only imported numpy which is needed.

We have created a 4 x 3 matrix using array and we will reshape it.
```
matrix = np.array([[11, 22, 33],
[44, 55, 66],
[77, 88, 99],
[110, 121, 132]])
```

We can reshape the matrix by using reshape function. In the function we have to pass the shape of the final matrix we want. (If we want a matrix of n by m then we have to pass (n,m)).
```
print(matrix.reshape(2, 6))
print(matrix.reshape(3, 4))
print(matrix.reshape(6, 2))
```

So the output comes as

[[ 11 22 33 44 55 66] [ 77 88 99 110 121 132]] [[ 11 22 33 44] [ 55 66 77 88] [ 99 110 121 132]] [[ 11 22] [ 33 44] [ 55 66] [ 77 88] [ 99 110] [121 132]]

In this project, we are going to work on Deep Learning using H2O to predict Census income.

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.

Machine Learning Project in R- Predict the customer churn of telecom sector and find out the key drivers that lead to churn. Learn how the logistic regression model using R can be used to identify the customer churn in telecom dataset.

Deep Learning Project- Learn to apply deep learning paradigm to forecast univariate time series data.

In this project, we are going to work on Sequence to Sequence Prediction using IMDB Movie Review Datasetâ€‹ using Keras in Python.

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

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.

There are different time series forecasting methods to forecast stock price, demand etc. In this machine learning project, you will learn to determine which forecasting method to be used when and how to apply with time series forecasting example.

In this data science project, you will predict borrowers chance of defaulting on credit loans by building a credit score prediction model.