当前位置: 首页>>代码示例>>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;未经允许,请勿转载。