Answers for "numpy matrix"

5

numpy matrix

>>> np.array([[1, 2], [3, 4]])
array([[1, 2],
       [3, 4]])
#np.matrix is no longer recommended!
Posted by: Guest on April-13-2021
3

numpy matrix in python 3

np.matrix([[1, 2], [3, 4]])

# matrix([[1, 2],
#         [3, 4]])
Posted by: Guest on September-27-2020
7

numpy

>>> import numpy as np
>>> a = np.array([2,3,4])
>>> a
array([2, 3, 4])
>>> a.dtype
dtype('int64')
>>> b = np.array([1.2, 3.5, 5.1])
>>> b.dtype
dtype('float64')
Posted by: Guest on February-13-2020

Python Answers by Framework

Browse Popular Code Answers by Language