October 2017
Intermediate to advanced
532 pages
16h 10m
English
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_, ...
Read now
Unlock full access