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


Python testing.getSeriesData方法代码示例

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


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

示例1: setup_method

# 需要导入模块: from pandas.util import testing [as 别名]
# 或者: from pandas.util.testing import getSeriesData [as 别名]
def setup_method(self, method):
        self.frame = DataFrame(tm.getSeriesData())
        self.mixed_frame = self.frame.copy()
        self.mixed_frame['foo'] = 'bar' 
开发者ID:Frank-qlu,项目名称:recruit,代码行数:6,代码来源:test_concat.py

示例2: seriesd

# 需要导入模块: from pandas.util import testing [as 别名]
# 或者: from pandas.util.testing import getSeriesData [as 别名]
def seriesd():
    return tm.getSeriesData() 
开发者ID:Frank-qlu,项目名称:recruit,代码行数:4,代码来源:conftest.py

示例3: float_frame

# 需要导入模块: from pandas.util import testing [as 别名]
# 或者: from pandas.util.testing import getSeriesData [as 别名]
def float_frame():
    """
    Fixture for DataFrame of floats with index of unique strings

    Columns are ['A', 'B', 'C', 'D'].
    """
    return DataFrame(tm.getSeriesData()) 
开发者ID:Frank-qlu,项目名称:recruit,代码行数:9,代码来源:conftest.py

示例4: float_frame_with_na

# 需要导入模块: from pandas.util import testing [as 别名]
# 或者: from pandas.util.testing import getSeriesData [as 别名]
def float_frame_with_na():
    """
    Fixture for DataFrame of floats with index of unique strings

    Columns are ['A', 'B', 'C', 'D']; some entries are missing
    """
    df = DataFrame(tm.getSeriesData())
    # set some NAs
    df.loc[5:10] = np.nan
    df.loc[15:20, -2:] = np.nan
    return df 
开发者ID:Frank-qlu,项目名称:recruit,代码行数:13,代码来源:conftest.py

示例5: bool_frame_with_na

# 需要导入模块: from pandas.util import testing [as 别名]
# 或者: from pandas.util.testing import getSeriesData [as 别名]
def bool_frame_with_na():
    """
    Fixture for DataFrame of booleans with index of unique strings

    Columns are ['A', 'B', 'C', 'D']; some entries are missing
    """
    df = DataFrame(tm.getSeriesData()) > 0
    df = df.astype(object)
    # set some NAs
    df.loc[5:10] = np.nan
    df.loc[15:20, -2:] = np.nan
    return df 
开发者ID:Frank-qlu,项目名称:recruit,代码行数:14,代码来源:conftest.py

示例6: int_frame

# 需要导入模块: from pandas.util import testing [as 别名]
# 或者: from pandas.util.testing import getSeriesData [as 别名]
def int_frame():
    """
    Fixture for DataFrame of ints with index of unique strings

    Columns are ['A', 'B', 'C', 'D']
    """
    df = DataFrame({k: v.astype(int)
                   for k, v in compat.iteritems(tm.getSeriesData())})
    # force these all to int64 to avoid platform testing issues
    return DataFrame({c: s for c, s in compat.iteritems(df)}, dtype=np.int64) 
开发者ID:Frank-qlu,项目名称:recruit,代码行数:12,代码来源:conftest.py

示例7: float_string_frame

# 需要导入模块: from pandas.util import testing [as 别名]
# 或者: from pandas.util.testing import getSeriesData [as 别名]
def float_string_frame():
    """
    Fixture for DataFrame of floats and strings with index of unique strings

    Columns are ['A', 'B', 'C', 'D', 'foo'].
    """
    df = DataFrame(tm.getSeriesData())
    df['foo'] = 'bar'
    return df 
开发者ID:Frank-qlu,项目名称:recruit,代码行数:11,代码来源:conftest.py

示例8: mixed_float_frame

# 需要导入模块: from pandas.util import testing [as 别名]
# 或者: from pandas.util.testing import getSeriesData [as 别名]
def mixed_float_frame():
    """
    Fixture for DataFrame of different float types with index of unique strings

    Columns are ['A', 'B', 'C', 'D'].
    """
    df = DataFrame(tm.getSeriesData())
    df.A = df.A.astype('float32')
    df.B = df.B.astype('float32')
    df.C = df.C.astype('float16')
    df.D = df.D.astype('float64')
    return df 
开发者ID:Frank-qlu,项目名称:recruit,代码行数:14,代码来源:conftest.py

示例9: mixed_float_frame2

# 需要导入模块: from pandas.util import testing [as 别名]
# 或者: from pandas.util.testing import getSeriesData [as 别名]
def mixed_float_frame2():
    """
    Fixture for DataFrame of different float types with index of unique strings

    Columns are ['A', 'B', 'C', 'D'].
    """
    df = DataFrame(tm.getSeriesData())
    df.D = df.D.astype('float32')
    df.C = df.C.astype('float32')
    df.B = df.B.astype('float16')
    df.D = df.D.astype('float64')
    return df 
开发者ID:Frank-qlu,项目名称:recruit,代码行数:14,代码来源:conftest.py

示例10: test_invert

# 需要导入模块: from pandas.util import testing [as 别名]
# 或者: from pandas.util.testing import getSeriesData [as 别名]
def test_invert(self):
        _seriesd = tm.getSeriesData()
        df = pd.DataFrame(_seriesd)

        assert_frame_equal(-(df < 0), ~(df < 0)) 
开发者ID:Frank-qlu,项目名称:recruit,代码行数:7,代码来源:test_operators.py

示例11: frame

# 需要导入模块: from pandas.util import testing [as 别名]
# 或者: from pandas.util.testing import getSeriesData [as 别名]
def frame():
    return DataFrame(tm.getSeriesData()) 
开发者ID:Frank-qlu,项目名称:recruit,代码行数:4,代码来源:test_to_latex.py

示例12: test_to_html_columns_arg

# 需要导入模块: from pandas.util import testing [as 别名]
# 或者: from pandas.util.testing import getSeriesData [as 别名]
def test_to_html_columns_arg():
    df = DataFrame(tm.getSeriesData())
    result = df.to_html(columns=['A'])
    assert '<th>B</th>' not in result 
开发者ID:Frank-qlu,项目名称:recruit,代码行数:6,代码来源:test_to_html.py

示例13: test_to_html_columns_arg

# 需要导入模块: from pandas.util import testing [as 别名]
# 或者: from pandas.util.testing import getSeriesData [as 别名]
def test_to_html_columns_arg(self):
        frame = DataFrame(tm.getSeriesData())
        result = frame.to_html(columns=['A'])
        assert '<th>B</th>' not in result 
开发者ID:birforce,项目名称:vnpy_crypto,代码行数:6,代码来源:test_to_html.py

示例14: setUp

# 需要导入模块: from pandas.util import testing [as 别名]
# 或者: from pandas.util.testing import getSeriesData [as 别名]
def setUp(self):
        self.frame = DataFrame(tm.getSeriesData())
        self.mixed_frame = self.frame.copy()
        self.mixed_frame['foo'] = 'bar' 
开发者ID:ktraunmueller,项目名称:Computable,代码行数:6,代码来源:test_merge.py


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