Skip to content

Commit 4d563d8

Browse files
author
Olivier Davant
committed
Examples updated for 1.0.0b16
1 parent 12f6527 commit 4d563d8

11 files changed

+11975
-1519
lines changed

Examples/2-Content/2.01-HistoricalPricing/EX-2.01.02-HistoricalPricing-ParallelRequests.ipynb

Lines changed: 1036 additions & 1073 deletions
Large diffs are not rendered by default.

Examples/2-Content/2.02-Pricing/EX-2.02.02-Pricing-StreamingWithDataFrame.ipynb

Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@
6666
},
6767
{
6868
"cell_type": "code",
69-
"execution_count": 2,
69+
"execution_count": 3,
7070
"metadata": {},
7171
"outputs": [],
7272
"source": [
@@ -87,16 +87,16 @@
8787
},
8888
{
8989
"cell_type": "code",
90-
"execution_count": 3,
90+
"execution_count": 4,
9191
"metadata": {},
9292
"outputs": [
9393
{
9494
"data": {
9595
"text/plain": [
96-
"<refinitiv.data.session.Definition object at 0x7f83b3979b10 {name='workspace'}>"
96+
"<refinitiv.data.session.Definition object at 0x7ff41524d4f0 {name='workspace'}>"
9797
]
9898
},
99-
"execution_count": 3,
99+
"execution_count": 4,
100100
"metadata": {},
101101
"output_type": "execute_result"
102102
}
@@ -119,9 +119,16 @@
119119
"### Define callbacks to receive streaming data"
120120
]
121121
},
122+
{
123+
"cell_type": "markdown",
124+
"metadata": {},
125+
"source": [
126+
"### Create a stream and open it"
127+
]
128+
},
122129
{
123130
"cell_type": "code",
124-
"execution_count": 4,
131+
"execution_count": 5,
125132
"metadata": {},
126133
"outputs": [],
127134
"source": [
@@ -139,24 +146,17 @@
139146
" display(df)\n",
140147
"\n",
141148
"\n",
142-
"def update_dataframe(streaming_prices, instrument_name, fields):\n",
149+
"def update_dataframe(fields, instrument_name, streaming_prices):\n",
143150
" global df\n",
144151
" clear_output(wait=True)\n",
145152
" for field_name, field_value in fields.items():\n",
146153
" df.at[instrument_name, field_name] = field_value\n",
147154
" display(df)"
148155
]
149156
},
150-
{
151-
"cell_type": "markdown",
152-
"metadata": {},
153-
"source": [
154-
"### Create a stream and open it"
155-
]
156-
},
157157
{
158158
"cell_type": "code",
159-
"execution_count": 5,
159+
"execution_count": 6,
160160
"metadata": {},
161161
"outputs": [
162162
{
@@ -187,34 +187,34 @@
187187
" <tbody>\n",
188188
" <tr>\n",
189189
" <th>EUR=</th>\n",
190-
" <td>1.1331</td>\n",
191-
" <td>1.1335</td>\n",
190+
" <td>1.053</td>\n",
191+
" <td>1.0534</td>\n",
192192
" </tr>\n",
193193
" <tr>\n",
194194
" <th>GBP=</th>\n",
195-
" <td>1.3352</td>\n",
196-
" <td>1.3356</td>\n",
195+
" <td>1.2264</td>\n",
196+
" <td>1.2265</td>\n",
197197
" </tr>\n",
198198
" <tr>\n",
199199
" <th>JPY=</th>\n",
200-
" <td>114.15</td>\n",
201-
" <td>114.16</td>\n",
200+
" <td>136.26</td>\n",
201+
" <td>136.29</td>\n",
202202
" </tr>\n",
203203
" <tr>\n",
204204
" <th>CAD=</th>\n",
205-
" <td>1.2782</td>\n",
206-
" <td>1.2783</td>\n",
205+
" <td>1.2937</td>\n",
206+
" <td>1.2941</td>\n",
207207
" </tr>\n",
208208
" </tbody>\n",
209209
"</table>\n",
210210
"</div>"
211211
],
212212
"text/plain": [
213213
" BID ASK\n",
214-
"EUR= 1.1331 1.1335\n",
215-
"GBP= 1.3352 1.3356\n",
216-
"JPY= 114.15 114.16\n",
217-
"CAD= 1.2782 1.2783"
214+
"EUR= 1.053 1.0534\n",
215+
"GBP= 1.2264 1.2265\n",
216+
"JPY= 136.26 136.29\n",
217+
"CAD= 1.2937 1.2941"
218218
]
219219
},
220220
"metadata": {},
@@ -243,16 +243,16 @@
243243
},
244244
{
245245
"cell_type": "code",
246-
"execution_count": 6,
246+
"execution_count": 7,
247247
"metadata": {},
248248
"outputs": [
249249
{
250250
"data": {
251251
"text/plain": [
252-
"<OpenState.Closed: 3>"
252+
"<OpenState.Closed: 'Closed'>"
253253
]
254254
},
255-
"execution_count": 6,
255+
"execution_count": 7,
256256
"metadata": {},
257257
"output_type": "execute_result"
258258
}
@@ -270,7 +270,7 @@
270270
},
271271
{
272272
"cell_type": "code",
273-
"execution_count": 7,
273+
"execution_count": 8,
274274
"metadata": {},
275275
"outputs": [],
276276
"source": [
@@ -287,7 +287,7 @@
287287
],
288288
"metadata": {
289289
"kernelspec": {
290-
"display_name": "Python 3",
290+
"display_name": "Python 3 (ipykernel)",
291291
"language": "python",
292292
"name": "python3"
293293
},
@@ -301,7 +301,7 @@
301301
"name": "python",
302302
"nbconvert_exporter": "python",
303303
"pygments_lexer": "ipython3",
304-
"version": "3.7.6"
304+
"version": "3.9.7"
305305
}
306306
},
307307
"nbformat": 4,

0 commit comments

Comments
 (0)