To get an idea of how the equals operator works, let's compare each element to a scalar value:
>>> college_ugds_ == .0019
This works as expected but becomes problematic whenever you attempt to compare DataFrames with missing values. This same equals operator may be used to compare two DataFrames with one another on an element-by-element basis. Take, for instance, college_ugds_compared against itself, as follows:
At first glance, all the values appear to be equal, as you would expect. However, using the all method to determine if each column contains only True values yields an unexpected result:
This happens because missing values do not compare equally with one another. If you tried to count missing values using the equal operator and summing up the boolean columns, you would get zero for each one: