@@ -114,15 +114,15 @@ def _to_abs_path_set(self, l):
114
114
115
115
.. sourcecode:: python
116
116
117
- from graphlab.util import gl_pickle
118
- import graphlab as gl
117
+ import sframe
118
+ from sframe import GLPickle
119
119
120
120
obj = {'foo': gl.SFrame([1,2,3]),
121
121
'bar': gl.SArray([1,2,3]),
122
122
'foo-bar': ['foo-and-bar', gl.SFrame()]}
123
123
124
124
# Setup the GLPickler
125
- pickler = gl_pickle. GLPickler(filename = 'foo-bar')
125
+ pickler = GLPickler(filename = 'foo-bar')
126
126
pickler.dump(obj)
127
127
128
128
# The pickler has to be closed to make sure the files get closed.
@@ -132,7 +132,7 @@ def _to_abs_path_set(self, l):
132
132
133
133
.. sourcecode:: python
134
134
135
- unpickler = gl_pickle. GLUnpickler(filename = 'foo-bar')
135
+ unpickler = GLUnpickler(filename = 'foo-bar')
136
136
obj = unpickler.load()
137
137
unpickler.close()
138
138
print obj
@@ -143,14 +143,13 @@ def _to_abs_path_set(self, l):
143
143
144
144
.. sourcecode:: python
145
145
146
- unpickler = gl_pickle. GLUnpickler('foo-bar')
146
+ unpickler = GLUnpickler('foo-bar')
147
147
obj = unpickler.load()
148
148
unpickler.close()
149
149
print obj
150
150
151
-
152
151
Notes
153
- --------
152
+ -----
154
153
155
154
The GLC pickler saves the files into single zip archive with the following
156
155
file layout.
@@ -173,8 +172,6 @@ def _to_abs_path_set(self, l):
173
172
174
173
"gl_archive_dir_N"
175
174
176
-
177
-
178
175
"""
179
176
def __init__ (self , filename , protocol = - 1 , min_bytes_to_save = 0 ):
180
177
"""
@@ -335,10 +332,6 @@ def __gl_pickle_load__(cls, filename):
335
332
("SGraph", 'sgraph-save-path')
336
333
("Model", 'model-save-path')
337
334
338
- Note that the key difference between version 1.0 and 2.0 is that 2.0 of
339
- GLPickle is that version 2.0 saves the load_sframe method while 1.0
340
- saves the string name for the class (which was hard-coded in)
341
-
342
335
References
343
336
----------
344
337
- Python Pickle Docs(https://docs.python.org/2/library/_pickle.html)
0 commit comments