當前位置: 首頁>>代碼示例>>Python>>正文


Python pickle.read_pickle方法代碼示例

本文整理匯總了Python中pandas.io.pickle.read_pickle方法的典型用法代碼示例。如果您正苦於以下問題:Python pickle.read_pickle方法的具體用法?Python pickle.read_pickle怎麽用?Python pickle.read_pickle使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在pandas.io.pickle的用法示例。


在下文中一共展示了pickle.read_pickle方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: load

# 需要導入模塊: from pandas.io import pickle [as 別名]
# 或者: from pandas.io.pickle import read_pickle [as 別名]
def load(path):  # TODO remove in 0.13
    """
    Load pickled pandas object (or any other pickled object) from the specified
    file path

    Warning: Loading pickled data received from untrusted sources can be
    unsafe. See: http://docs.python.org/2.7/library/pickle.html

    Parameters
    ----------
    path : string
        File path

    Returns
    -------
    unpickled : type of object stored in file
    """
    import warnings
    warnings.warn("load is deprecated, use read_pickle", FutureWarning)
    from pandas.io.pickle import read_pickle
    return read_pickle(path) 
開發者ID:ktraunmueller,項目名稱:Computable,代碼行數:23,代碼來源:common.py

示例2: test_pickle_v0_15_2

# 需要導入模塊: from pandas.io import pickle [as 別名]
# 或者: from pandas.io.pickle import read_pickle [as 別名]
def test_pickle_v0_15_2(self, datapath):
        offsets = {'DateOffset': DateOffset(years=1),
                   'MonthBegin': MonthBegin(1),
                   'Day': Day(1),
                   'YearBegin': YearBegin(1),
                   'Week': Week(1)}

        pickle_path = datapath('tseries', 'offsets', 'data',
                               'dateoffset_0_15_2.pickle')
        # This code was executed once on v0.15.2 to generate the pickle:
        # with open(pickle_path, 'wb') as f: pickle.dump(offsets, f)
        #
        tm.assert_dict_equal(offsets, read_pickle(pickle_path)) 
開發者ID:Frank-qlu,項目名稱:recruit,代碼行數:15,代碼來源:test_offsets.py

示例3: test_pickle_compat_0_14_1

# 需要導入模塊: from pandas.io import pickle [as 別名]
# 或者: from pandas.io.pickle import read_pickle [as 別名]
def test_pickle_compat_0_14_1(self, datapath):
        hdays = [datetime(2013, 1, 1) for ele in range(4)]
        pth = datapath('tseries', 'offsets', 'data', 'cday-0.14.1.pickle')
        cday0_14_1 = read_pickle(pth)
        cday = CDay(holidays=hdays)
        assert cday == cday0_14_1 
開發者ID:Frank-qlu,項目名稱:recruit,代碼行數:8,代碼來源:test_offsets.py

示例4: load

# 需要導入模塊: from pandas.io import pickle [as 別名]
# 或者: from pandas.io.pickle import read_pickle [as 別名]
def load(self, path):  # TODO remove in 0.14
        "Deprecated. Use read_pickle instead."
        import warnings
        from pandas.io.pickle import read_pickle
        warnings.warn("load is deprecated, use pd.read_pickle", FutureWarning)
        return read_pickle(path) 
開發者ID:ktraunmueller,項目名稱:Computable,代碼行數:8,代碼來源:generic.py


注:本文中的pandas.io.pickle.read_pickle方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。