Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

Print the norm of a vector and a matrix using numpy.

# import library
import numpy as np
 
# initialize matrix
mat = np.array([[ 1, 2, 3],
               [4, 5, 6]])
 
# compute norm of matrix
mat_norm = np.linalg.norm(mat)
 
print("Matrix norm:")
print(mat_norm)
Comment

PREVIOUS NEXT
Code Example
Python :: dataframe fillna with 0 
Python :: from random import choice 
Python :: __gt__ 
Python :: how to remove in null values in pandas 
Python :: smtp email template 
Python :: python hello world 
Python :: how to randomize order of a list python 
Python :: accessing data on django sessionstore 
Python :: right angle triangle in python 
Python :: python read folder 
Python :: encrypt string python 
Python :: How to Create Caesar Cipher Using Python 
Python :: how to create a new virtualenv 
Python :: primary key django model 
Python :: mad libs in python 
Python :: python read html table 
Python :: python if string is null or whitespace 
Python :: instagram login with selenium py 
Python :: python convert dictionary to pandas dataframe 
Python :: python process memory usage 
Python :: how to generate random normal number in python 
Python :: pyqt5 qlineedit on change 
Python :: pandas change multiple column types 
Python :: pip install django rest framework 
Python :: selenium chromeoptions user agent 
Python :: merge and join dataframes with pandas in python 
Python :: django template tag multiple arguments 
Python :: decision tree classifier 
Python :: converting jupyter notebook files to python 
Python :: python regex search group 
ADD CONTENT
Topic
Content
Source link
Name
2+5 =