If you are comparing scalars, one way is to use assertTruewith isnull. For example, in UnitFrame ( pandas/tests/test_frame.py) unit tests, you can find tests like this :
self.assertTrue(com.isnull(df.ix['c', 'timestamp']))
(It comis an alias for pandas/core/common.py, therefore, it com.isnullcalls the same main function as pd.isnull.)
, , DataFrames , tm.assert_series_equal tm.assert_frame_equal. :
>>> import pandas.util.testing as tm
>>> df = pd.DataFrame({'a': [1, np.nan]})
>>> df
a
0 1
1 NaN
NaN NaN:
>>> df == df
a
0 True
1 False
assert_frame_equal NaN :
>>> tm.assert_frame_equal(df, df)