File tree 1 file changed +22
-0
lines changed
1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -27,6 +27,28 @@ New features
27
27
Other Enhancements
28
28
^^^^^^^^^^^^^^^^^^
29
29
30
+ Pickle file I/O protocol parameter
31
+ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
32
+
33
+ :func:`to_pickle` now allows to specify the protocol used by the Pickler.
34
+ The 'protocol' parameter defaults to HIGHEST_PROTOCOL. For Python 2.x, HIGHEST_PROTOCOL is 2.
35
+ Since Python 3.0 (respectively 3.4), HIGHEST_PROTOCOL is 3 (respectively 4).
36
+ A negative value for the protocol parameter is equivalent to setting its value to HIGHEST_PROTOCOL.
37
+
38
+ .. ipython:: python
39
+
40
+ df = pd.DataFrame({
41
+ 'A': np.random.randn(1000),
42
+ 'B': 'foo',
43
+ 'C': pd.date_range('20130101', periods=1000, freq='s')})
44
+
45
+ Using an explicit protocol parameter
46
+
47
+ .. ipython:: python
48
+
49
+ df.to_pickle("data.pkl", protocol=2)
50
+ rt = pd.read_pickle("data.pkl")
51
+ rt
30
52
31
53
32
54
.. _whatsnew_0210.api_breaking:
You can’t perform that action at this time.
0 commit comments