DATA MUNGING
DATA CLEANING PYTHON
MACHINE LEARNING RECIPES
PANDAS CHEATSHEET
ALL TAGS
# How to Create a Vector or Matrix in Python?

# How to Create a Vector or Matrix in Python?

This recipe helps you Create a Vector or Matrix in Python

Have you ever tried to create a transpose of a vector or matrix? Is"nt it very easy to calculate manually but if you have to calcuate transpose of many matrises then it may not be possible to do it manually.

So this is the recipe on how we can Create & Transpose a Vector or Matrix.

```
import numpy as np
```

We have only imported numpy which is needed.

We have created a vector and matrix using array and we will find transpose of it.
```
vector = np.array([10, 20, 30, 40, 50, 60])
print("Original Vector:
", vector)
matrix = np.array([[11, 22, 33],
[44, 55, 66],
[77, 88, 99]])
print("Original Matrix:
", matrix)
```

We can make transpose of vector and matrix by using T function, i.e. applying .T after the vector and matrix.
```
V = vector.T
print("Transpose Vector:
", V)
M = matrix.T
print("Transpose Matrix:
", M)
```

So the output comes as

Original Vector: [10 20 30 40 50 60] Original Matrix: [[11 22 33] [44 55 66] [77 88 99]] Transpose Vector: [10 20 30 40 50 60] Transpose Matrix: [[11 44 77] [22 55 88] [33 66 99]]

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.

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 supervised learning machine learning project, you will predict the availability of a driver in a specific area by using multi step time series analysis.

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.

Use the Amazon Reviews/Ratings dataset of 2 Million records to build a recommender system using memory-based collaborative filtering in Python.

In this project, we are going to talk about H2O and functionality in terms of building Machine Learning models.

In this data science project, you will learn how to perform market basket analysis with the application of Apriori and FP growth algorithms based on the concept of association rule learning.

This data science in python project predicts if a loan should be given to an applicant or not. We predict if the customer is eligible for loan based on several factors like credit score and past history.

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.

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