# Examples of Matrices and NumPy Arrays in Python Programming

A matrix is a two-dimensional data structure where numbers are arranged into rows and columns

Example of Python Matrix :

``````M = [[2, 5, 7],
[-4, 6, 8]]``````

### All Contributions

NumPy provides multidimensional array of numbers:

``````import numpy as np
a = np.array([1, 2, 3])
print(a)               # Output: [1, 2, 3]
print(type(a))         # Output: <class 'numpy.ndarray'>``````

NumPy provides multidimensional array of numbers:

``````import numpy as np
a = np.array([1, 2, 3])
print(a)               # Output: [1, 2, 3]
print(type(a))         # Output: <class 'numpy.ndarray'>``````

NumPy provides multidimensional array of numbers:

``````import numpy as np
a = np.array([1, 2, 3])
print(a)               # Output: [1, 2, 3]
print(type(a))         # Output: <class 'numpy.ndarray'>``````

NumPy provides multidimensional array of numbers:

``````import numpy as np
a = np.array([1, 2, 3])
print(a)               # Output: [1, 2, 3]
print(type(a))         # Output: <class 'numpy.ndarray'>``````

NumPy provides multidimensional array of numbers:

``````import numpy as np
a = np.array([1, 2, 3])
print(a)               # Output: [1, 2, 3]
print(type(a))         # Output: <class 'numpy.ndarray'>``````

total contributions (5)