Title: Describe An Array
Slug: describe_a_matrix
Summary: How to describe an array.
Date: 2017-09-03 12:00
Category: Machine Learning
Tags: Vectors Matrices Arrays
Authors: Chris Albon
In [1]:
# Load library
import numpy as np
In [2]:
# Create matrix
matrix = np.array([[1, 2, 3, 4],
[5, 6, 7, 8],
[9, 10, 11, 12]])
In [3]:
# View number of rows and columns
matrix.shape
Out[3]:
In [4]:
# View number of elements (rows * columns)
matrix.size
Out[4]:
In [5]:
# View number of dimensions
matrix.ndim
Out[5]: