There's more...

All the comparison operators have method counterparts that allow for more functionality. Somewhat confusingly, the eq DataFrame method does element-by-element comparison, just like the equals operator.The eq method is not at all the same as the equals method. It merely does a similar task as the equals operator. The following code duplicates step 1:

>>> college_ugds_.eq(.0019)    # same as college_ugds_ == .0019 

Inside the pandas.testing sub-package, a function exists that developers must use when creating unit tests. The assert_frame_equal function raises an AssertionError if two DataFrames are not equal. It returns None if the two passed frames are equal:

>>> from pandas.testing import assert_frame_equal
>>> assert_frame_equal(college_ugds_, college_ugds_)
Unit tests are a very important part of software development and ensure that the code is running correctly. Pandas contains many thousands of unit tests that help ensure that it is running properly. To read more on how pandas runs its unit tests, see the Contributing to pandas section in the documentation (http://bit.ly/2vmCSU6).
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
52.15.214.27