Solution Exercise 5: Convert a binary numpy matrix to a boolean
Exercise 5 Convert a numpy binary matrix (containing only '0' and '1') to a numpy boolean matrix (i.e. '1' will be replaced by 'True' and '0' by 'False') Solution import…
Solution Exercise 4: trace of numpy matrix without using the trace() method
Exercise 4 Resume the previous exercise (Exercise3) without using the trace() method. Solution import numpy as npdef matrix_trace(A): n = len(A) # initialization of trace of A trace = 0…
Solution Exercise 3: trace of numpy matrix
Exercise 3 Write a python function that takes a numpy matrix as a parameter and returns its trace. We recall that the trace of a square matrix A = (ai…
The HTML Hyperlink
Contenu du cours About hyperlinks Link to a URL address Link to a file Link to E-mail box Link in the same page 1. About hyperlinks In order to…
Variable In Python
Content Defining a Python variable Variable Naming Conventions Types of python variables Convert or change the type of a python variable Multiple assignment to python variables Object identity for python…
Introduction To HTML Language
Contenu du cours About HTML Language Prerequisites HTML tags The tools needed to develop in HTML 1. About HTML Language Acronym for "HyperText Markup Language", HTML is a really simple…
Solution Exercise 2: transpose of a matrix with numpy
Exercise 2 Write a python program using the numpy library that determines the transpose of the following matrix: A = numpy.array([[1, 2, 3], [4, 5, 6], [7, 8, 9,]]) Solution…