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

Preliminaries


In [ ]:
# Load library
import numpy as np

Create Matrix


In [ ]:
# Create matrix
matrix = np.array([[1, 2, 3, 4],
                   [5, 6, 7, 8],
                   [9, 10, 11, 12]])

View Shape


In [ ]:
# View number of rows and columns
matrix.shape

View Total Elements


In [ ]:
# View number of elements (rows * columns)
matrix.size

View Number Of Dimensions


In [ ]:
# View number of dimensions
matrix.ndim