zmc
2023-12-22 9fdbf60165db0400c2e8e6be2dc6e88138ac719a
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
U
¬ý°dã    @sâdZddlmZddlZddlmZddlZddlmZm    Z    m
Z
m Z m Z ddl mZddlmZddlmZdd    lmZeed
ed d d dejdfdddddddœdd„ƒZeed
edd ddddddœdd„ƒZdS)z pickle compat é)Ú annotationsN)ÚAny)ÚCompressionOptionsÚFilePathÚReadPickleBufferÚStorageOptionsÚ WriteBuffer)Ú pickle_compat)Údoc)Ú _shared_docs)Ú
get_handleÚstorage_optionsÚcompression_optionsÚfilepath_or_buffer)r rÚinferrzFilePath | WriteBuffer[bytes]rÚintrÚNone)ÚobjrÚ compressionÚprotocolr Úreturnc    CsB|dkrtj}t|d|d|d}tj||j|dW5QRXdS)aZ
    Pickle (serialize) object to file.
 
    Parameters
    ----------
    obj : any object
        Any python object.
    filepath_or_buffer : str, path object, or file-like object
        String, path object (implementing ``os.PathLike[str]``), or file-like
        object implementing a binary ``write()`` function.
        Also accepts URL. URL has to be of S3 or GCS.
    {compression_options}
 
        .. versionchanged:: 1.4.0 Zstandard support.
 
    protocol : int
        Int which indicates which protocol should be used by the pickler,
        default HIGHEST_PROTOCOL (see [1], paragraph 12.1.2). The possible
        values for this parameter depend on the version of Python. For Python
        2.x, possible values are 0, 1, 2. For Python>=3.0, 3 is a valid value.
        For Python >= 3.4, 4 is a valid value. A negative value for the
        protocol parameter is equivalent to setting its value to
        HIGHEST_PROTOCOL.
 
    {storage_options}
 
        .. versionadded:: 1.2.0
 
        .. [1] https://docs.python.org/3/library/pickle.html
 
    See Also
    --------
    read_pickle : Load pickled pandas object (or any object) from file.
    DataFrame.to_hdf : Write DataFrame to an HDF5 file.
    DataFrame.to_sql : Write DataFrame to a SQL database.
    DataFrame.to_parquet : Write a DataFrame to the binary parquet format.
 
    Examples
    --------
    >>> original_df = pd.DataFrame({{"foo": range(5), "bar": range(5, 10)}})  # doctest: +SKIP
    >>> original_df  # doctest: +SKIP
       foo  bar
    0    0    5
    1    1    6
    2    2    7
    3    3    8
    4    4    9
    >>> pd.to_pickle(original_df, "./dummy.pkl")  # doctest: +SKIP
 
    >>> unpickled_df = pd.read_pickle("./dummy.pkl")  # doctest: +SKIP
    >>> unpickled_df  # doctest: +SKIP
       foo  bar
    0    0    5
    1    1    6
    2    2    7
    3    3    8
    4    4    9
    rÚwbF©rZis_textr )rN)ÚpickleÚHIGHEST_PROTOCOLr ÚdumpÚhandle)rrrrr Úhandles©rúGd:\z\workplace\vscode\pyvenv\venv\Lib\site-packages\pandas/io/pickle.pyÚ    to_picklesEûr Údecompression_options)r r!zFilePath | ReadPickleBuffer)rrr c Csättttf}t|d|d|d¼}z„zLtjdd6t dt¡t     
|j ¡W5QR£WWW5QR£SQRXWn2|k
r t j
|j ddYWW5QR£SXWn0t k
rÔt j
|j d    dYW5QR£SXW5QRXdS)
að
    Load pickled pandas object (or any object) from file.
 
    .. warning::
 
       Loading pickled data received from untrusted sources can be
       unsafe. See `here <https://docs.python.org/3/library/pickle.html>`__.
 
    Parameters
    ----------
    filepath_or_buffer : str, path object, or file-like object
        String, path object (implementing ``os.PathLike[str]``), or file-like
        object implementing a binary ``readlines()`` function.
        Also accepts URL. URL is not limited to S3 and GCS.
 
    {decompression_options}
 
        .. versionchanged:: 1.4.0 Zstandard support.
 
    {storage_options}
 
        .. versionadded:: 1.2.0
 
    Returns
    -------
    same type as object stored in file
 
    See Also
    --------
    DataFrame.to_pickle : Pickle (serialize) DataFrame object to file.
    Series.to_pickle : Pickle (serialize) Series object to file.
    read_hdf : Read HDF5 file into a DataFrame.
    read_sql : Read SQL query or database table into a DataFrame.
    read_parquet : Load a parquet object, returning a DataFrame.
 
    Notes
    -----
    read_pickle is only guaranteed to be backwards compatible to pandas 0.20.3
    provided the object was serialized with to_pickle.
 
    Examples
    --------
    >>> original_df = pd.DataFrame(
    ...     {{"foo": range(5), "bar": range(5, 10)}}
    ...    )  # doctest: +SKIP
    >>> original_df  # doctest: +SKIP
       foo  bar
    0    0    5
    1    1    6
    2    2    7
    3    3    8
    4    4    9
    >>> pd.to_pickle(original_df, "./dummy.pkl")  # doctest: +SKIP
 
    >>> unpickled_df = pd.read_pickle("./dummy.pkl")  # doctest: +SKIP
    >>> unpickled_df  # doctest: +SKIP
       foo  bar
    0    0    5
    1    1    6
    2    2    7
    3    3    8
    4    4    9
    ÚrbFrT)ÚrecordÚignoreN)Úencodingzlatin-1)ÚAttributeErrorÚ ImportErrorÚModuleNotFoundErrorÚ    TypeErrorr ÚwarningsÚcatch_warningsÚ simplefilterÚWarningrÚloadrÚpcÚUnicodeDecodeError)rrr Z excs_to_catchrrrrÚ read_picklejs$H û 2(r1)rN)Ú__doc__Ú
__future__rrÚtypingrr*Zpandas._typingrrrrrZ pandas.compatr    r/Zpandas.util._decoratorsr
Zpandas.core.shared_docsr Zpandas.io.commonr rr r1rrrrÚ<module>s0      
þûO
þý