Participer au site avec un Tip
Rechercher
 

Améliorations / Corrections

Vous avez des améliorations (ou des corrections) à proposer pour ce document : je vous remerçie par avance de m'en faire part, cela m'aide à améliorer le site.

Emplacement :

Description des améliorations :

Vous êtes un professionnel et vous avez besoin d'une formation ? Machine Learning
avec Scikit-Learn
Voir le programme détaillé
Module « numpy.testing »

Fonction print_assert_equal - module numpy.testing

Signature de la fonction print_assert_equal

def print_assert_equal(test_string, actual, desired) 

Description

help(numpy.testing.print_assert_equal)

Test if two objects are equal, and print an error message if test fails.

The test is performed with ``actual == desired``.

Parameters
----------
test_string : str
    The message supplied to AssertionError.
actual : object
    The object to test for equality against `desired`.
desired : object
    The expected result.

Examples
--------
>>> np.testing.print_assert_equal('Test XYZ of func xyz', [0, 1], [0, 1])
>>> np.testing.print_assert_equal('Test XYZ of func xyz', [0, 1], [0, 2])
Traceback (most recent call last):
...
AssertionError: Test XYZ of func xyz failed
ACTUAL:
[0, 1]
DESIRED:
[0, 2]



Vous êtes un professionnel et vous avez besoin d'une formation ? Programmation Python
Les compléments
Voir le programme détaillé