Show More
@@ -108,13 +108,13 b' Code cells' | |||
|
108 | 108 | Code cells are the primary content of Jupyter notebooks. |
|
109 | 109 | They contain source code int e language of the document's associated kernel, |
|
110 | 110 | and a list of outputs associated with executing. |
|
111 |
They also have a |
|
|
111 | They also have an execution_count, which must be an integer or ``null``. | |
|
112 | 112 | |
|
113 | 113 | .. sourcecode:: python |
|
114 | 114 | |
|
115 | 115 | { |
|
116 | 116 | "cell_type" : "code", |
|
117 |
" |
|
|
117 | "execution_count": 1, # integer or null | |
|
118 | 118 | "metadata" : { |
|
119 | 119 | "collapsed" : True, # whether the output of the cell is collapsed |
|
120 | 120 | "autoscroll": False, # any of true, false or "auto" |
@@ -131,6 +131,10 b' They also have a prompt_number, which must be an integer or ``null``.' | |||
|
131 | 131 | |
|
132 | 132 | ``input`` was renamed to ``source``, for consistency among cell types. |
|
133 | 133 | |
|
134 | .. versionchanged:: 4.0 | |
|
135 | ||
|
136 | ``prompt_number`` renamed to ``execution_count`` | |
|
137 | ||
|
134 | 138 | Code cell outputs |
|
135 | 139 | ----------------- |
|
136 | 140 | |
@@ -170,11 +174,13 b' The metadata of these messages may be keyed by mime-type as well.' | |||
|
170 | 174 | |
|
171 | 175 | { |
|
172 | 176 | "output_type" : "display_data", |
|
173 | "text/plain" : ["multiline text data"], | |
|
174 | "image/png": ["base64-encoded-png-data"], | |
|
175 | "application/json": { | |
|
176 | # JSON data is included as-is | |
|
177 | "json": "data", | |
|
177 | "data" : { | |
|
178 | "text/plain" : ["multiline text data"], | |
|
179 | "image/png": ["base64-encoded-png-data"], | |
|
180 | "application/json": { | |
|
181 | # JSON data is included as-is | |
|
182 | "json": "data", | |
|
183 | }, | |
|
178 | 184 | }, |
|
179 | 185 | "metadata" : { |
|
180 | 186 | "image/png": { |
@@ -192,7 +198,8 b' The metadata of these messages may be keyed by mime-type as well.' | |||
|
192 | 198 | .. versionchanged:: 4.0 |
|
193 | 199 | |
|
194 | 200 | mime-types are used for keys, instead of a combination of short names (``text``) |
|
195 | and mime-types. | |
|
201 | and mime-types, and are stored in a ``data`` key, rather than the top-level. | |
|
202 | i.e. ``output.data['image/png']`` instead of ``output.png``. | |
|
196 | 203 | |
|
197 | 204 | |
|
198 | 205 | execute_result |
@@ -207,12 +214,14 b' adding only a ``prompt_number`` field, which must be an integer.' | |||
|
207 | 214 | |
|
208 | 215 | { |
|
209 | 216 | "output_type" : "execute_result", |
|
210 | "prompt_number": 42, | |
|
211 | "text/plain" : ["multiline text data"], | |
|
212 | "image/png": ["base64-encoded-png-data"], | |
|
213 | "application/json": { | |
|
214 | # JSON data is included as-is | |
|
215 | "json": "data", | |
|
217 | "execute_result": 42, | |
|
218 | "data" : { | |
|
219 | "text/plain" : ["multiline text data"], | |
|
220 | "image/png": ["base64-encoded-png-data"], | |
|
221 | "application/json": { | |
|
222 | # JSON data is included as-is | |
|
223 | "json": "data", | |
|
224 | }, | |
|
216 | 225 | }, |
|
217 | 226 | "metadata" : { |
|
218 | 227 | "image/png": { |
@@ -226,6 +235,10 b' adding only a ``prompt_number`` field, which must be an integer.' | |||
|
226 | 235 | |
|
227 | 236 | ``pyout`` renamed to ``execute_result`` |
|
228 | 237 | |
|
238 | .. versionchanged:: 4.0 | |
|
239 | ||
|
240 | ``prompt_number`` renamed to ``execution_count`` | |
|
241 | ||
|
229 | 242 | |
|
230 | 243 | error |
|
231 | 244 | ***** |
General Comments 0
You need to be logged in to leave comments.
Login now