當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。