Skip to content

Commit 8457cf9

Browse files
committed
Merge branch 'cosmos-revamped-notebook-docs' of https://github.com/seesharprun/azure-docs-pr into cosmos-revamped-notebook-docs
2 parents 169a614 + cd46fcd commit 8457cf9

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

articles/cosmos-db/sql/tutorial-create-notebook.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,36 @@ In this section, you'll create the Azure Cosmos database, container, and import
247247

248248
1. Create another new code cell.
249249

250+
1. In the code cell, create a dictionary by adding unique permutations of the **Item** field as the key and the data in the **Price** field as the value.
251+
252+
```csharp
253+
var dictionary = new Dictionary<string, decimal>();
254+
255+
foreach(var result in results)
256+
{
257+
dictionary.TryAdd (result.Item, result.Price);
258+
}
259+
260+
dictionary
261+
```
262+
263+
1. Select **Run Active Cell** to only run the command in this specific cell.
264+
265+
1. Observe the output with unique combinations of the **Item** and **Price** fields.
266+
267+
```output
268+
...
269+
Denim Jacket:31.99
270+
Fleece Jacket:65
271+
Sandals:12
272+
Socks:3.75
273+
Sandal:35.5
274+
Light Jeans:80
275+
...
276+
```
277+
278+
1. Create another new code cell.
279+
250280
1. In the code cell, output the **results** variable.
251281

252282
```csharp

0 commit comments

Comments
 (0)