numpy.MaskedArray.allequal() returns True if all records a and b are equal, using fill_value as truth value, where one or both are masked. p>
numpy.ma.allequal (arr1, arr2, fill_value = True)
arr1, arr2: [array_like] Input arrays to compare.
fill_value: [bool, optional] Whether masked values in arr1 or arr2 are considered equal (True) or not (False).
Return: [bool] Returns True if the two arrays are equal within the given tolerance, False otherwise. If either array contains NaN, then False is returned.
Code # 1:
1st Input array: [1.0 e + 08 1.0e-05 -1.5e + 01] 1st Masked array: [100000000.0 1e-05 -] 2nd Input array: [1.0e + 08 1.0e-05 1.5e + 01] 2nd Masked array: [100000000.0 1e-05 -] Output array: False
Code # 2:
code > Output :
1st Input array: [2.0e + 08 3.0e-05 -4.5e + 01] 1st Masked array: [200000000.0 3e-05 -] 2nd Input array: [2.0e + 08 3.0e-05 1.5e + 01] 2nd Masked array: [200000000.0 3e-05 -] Output array: True
This book is not just about learning the code; even if you learn to program. If you want to program professionally, learning to code is not enough; For this reason, in addition to helping you program,...
Python Crash Course is the world's best-selling guide to the Python programming language. This quick and in-depth introduction to Python programming will get you started writing programs, solving prob...
As the title promises, this book will introduce you to one of the world’s most popular programming languages: Python. It’s aimed at beginning programmers as well as more experienced programmers wh...
A Problem-Solver’s Guide to Building Real-World Intelligent Systems. Data is the new oil and Machine Learning is a powerful concept and framework for making the best out of it. In this age of aut...