当前位置: 首页>>代码示例>>Python>>正文


Python testing.assert_class_equal方法代码示例

本文整理汇总了Python中pandas.util.testing.assert_class_equal方法的典型用法代码示例。如果您正苦于以下问题:Python testing.assert_class_equal方法的具体用法?Python testing.assert_class_equal怎么用?Python testing.assert_class_equal使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在pandas.util.testing的用法示例。


在下文中一共展示了testing.assert_class_equal方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_series_indexing_single

# 需要导入模块: from pandas.util import testing [as 别名]
# 或者: from pandas.util.testing import assert_class_equal [as 别名]
def test_series_indexing_single(self):
        for i, idx in enumerate(self.cols):
            assert self.ss.iloc[i] == self.ss[idx]
            tm.assert_class_equal(self.ss.iloc[i], self.ss[idx],
                                  obj="series index")

        assert self.ss['string'] == 'a'
        assert self.ss['int'] == 1
        assert self.ss['float'] == 1.1
        assert self.ss['object'] == [] 
开发者ID:Frank-qlu,项目名称:recruit,代码行数:12,代码来源:test_indexing.py

示例2: test_iloc

# 需要导入模块: from pandas.util import testing [as 别名]
# 或者: from pandas.util.testing import assert_class_equal [as 别名]
def test_iloc(self, float_frame):

        # GH 2227
        result = float_frame.iloc[:, 0]
        assert isinstance(result, SparseSeries)
        tm.assert_sp_series_equal(result, float_frame['A'])

        # preserve sparse index type. #2251
        data = {'A': [0, 1]}
        iframe = SparseDataFrame(data, default_kind='integer')
        tm.assert_class_equal(iframe['A'].sp_index,
                              iframe.iloc[:, 0].sp_index) 
开发者ID:Frank-qlu,项目名称:recruit,代码行数:14,代码来源:test_frame.py

示例3: test_dict_complex

# 需要导入模块: from pandas.util import testing [as 别名]
# 或者: from pandas.util.testing import assert_class_equal [as 别名]
def test_dict_complex(self):
        x = {'foo': 1.0 + 1.0j, 'bar': 2.0 + 2.0j}
        x_rec = self.encode_decode(x)
        tm.assert_dict_equal(x, x_rec)

        for key in x:
            tm.assert_class_equal(x[key], x_rec[key], obj="complex value") 
开发者ID:Frank-qlu,项目名称:recruit,代码行数:9,代码来源:test_packers.py

示例4: test_dict_numpy_complex

# 需要导入模块: from pandas.util import testing [as 别名]
# 或者: from pandas.util.testing import assert_class_equal [as 别名]
def test_dict_numpy_complex(self):
        x = {'foo': np.complex128(1.0 + 1.0j),
             'bar': np.complex128(2.0 + 2.0j)}
        x_rec = self.encode_decode(x)
        tm.assert_dict_equal(x, x_rec)

        for key in x:
            tm.assert_class_equal(x[key], x_rec[key], obj="numpy complex128") 
开发者ID:Frank-qlu,项目名称:recruit,代码行数:10,代码来源:test_packers.py

示例5: test_iloc

# 需要导入模块: from pandas.util import testing [as 别名]
# 或者: from pandas.util.testing import assert_class_equal [as 别名]
def test_iloc(self):

        # 2227
        result = self.frame.iloc[:, 0]
        assert isinstance(result, SparseSeries)
        tm.assert_sp_series_equal(result, self.frame['A'])

        # preserve sparse index type. #2251
        data = {'A': [0, 1]}
        iframe = SparseDataFrame(data, default_kind='integer')
        tm.assert_class_equal(iframe['A'].sp_index,
                              iframe.iloc[:, 0].sp_index) 
开发者ID:birforce,项目名称:vnpy_crypto,代码行数:14,代码来源:test_frame.py


注:本文中的pandas.util.testing.assert_class_equal方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。