You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/cosmos-db/cosmosdb-jupyter-notebooks.md
+12-15Lines changed: 12 additions & 15 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -24,39 +24,36 @@ Azure Cosmos DB supports both C# and Python notebooks for all APIs, including Co
24
24
25
25
Jupyter notebooks were originally developed for data science applications written in Python and R. However, they can be used in various ways for different kinds of projects, including:
26
26
27
-
****Data visualization:** Jupyter notebooks allow you to visualize data in the form of a shared notebook that renders a data set as a graphic. You can create visualizations, make interactive changes to the shared code and data set, and share the results.
27
+
**Data visualization:** Jupyter notebooks allow you to visualize data in the form of a shared notebook that renders a data set as a graphic. You can create visualizations, make interactive changes to the shared code and data set, and share the results.
28
28
29
-
***Code sharing:** Services like GitHub provide ways to share code, but they're largely non-interactive. With a Jupyter notebook, you can view code, execute it, and display the results directly in the Azure portal.
29
+
**Code sharing:** Services like GitHub provide ways to share code, but they're largely non-interactive. With a Jupyter notebook, you can view code, execute it, and display the results directly in the Azure portal.
30
30
31
-
***Live interactions with code:** Code in a Jupyter notebook is dynamic; it can be edited and rerun incrementally in real time. You can also embed user controls (for example, sliders or text input fields) that can be used as input sources for code, demos, or Proof of Concepts (POCs).
31
+
**Live interactions with code:** Code in a Jupyter notebook is dynamic; you can edit it and run the updates incrementally in real time. You can also embed user controls (for example, sliders or text input fields) that are used as input sources for code, demos, or Proof of Concepts (POCs).
32
32
33
-
***Documentation of code samples and outcomes of data exploration:** If you have a piece of code and you want to explain line-by-line how it works, you can embed it in a Jupyter Notebook. You can add interactivity along with the documentation at the same time.
33
+
**Documentation of code samples and outcomes of data exploration:** If you have a piece of code and you want to explain line-by-line how it works, you can embed it in a Jupyter Notebook. You can add interactivity along with the documentation at the same time.
34
34
35
-
***Built-in commands for Azure Cosmos DB:** Azure Cosmos DB's built-in magic commands make it easy to interact with your account. You can use commands like %%upload and %%sql to upload data into a container and query it using [SQL API syntax](sql-query-getting-started.md), no custom code required.
35
+
**Built-in commands for Azure Cosmos DB:** Azure Cosmos DB's built-in magic commands make it easy to interact with your account. You can use commands like %%upload and %%sql to upload data into a container and query it using [SQL API syntax](sql-query-getting-started.md). You don't need to write additional custom code.
36
36
37
-
***All in one place environment:** Jupyter notebooks combine code, rich text, images, videos, animations, mathematical equations, plots, maps, interactive figures, widgets, and graphical user interfaces into a single document.
37
+
**All in one place environment:** Jupyter notebooks combine code, rich text, images, videos, animations, mathematical equations, plots, maps, interactive figures, widgets, and graphical user interfaces into a single document.
38
38
39
39
## Components of a Jupyter notebook
40
40
41
41
Jupyter notebooks can include several types of components, each organized into discrete blocks or cells:
42
42
43
-
***Text and HTML:** Plain text, or text annotated in the markdown syntax to generate HTML, can be inserted into the document at any point. CSS styling can also be included inline or added to the template used to generate the notebook.
43
+
**Text and HTML:** Plain text, or text annotated in the markdown syntax to generate HTML, can be inserted into the document at any point. CSS styling can also be included inline or added to the template used to generate the notebook.
44
44
45
-
***Code and output:** Jupyter notebooks support Python and C# code. The results of the executed code appear immediately after the code blocks, and the code blocks can be executed multiple times in any order you like.
45
+
**Code and output:** Jupyter notebooks support Python and C# code. The results of the executed code appear immediately after the code blocks, and the code blocks can be executed multiple times in any order you like.
46
46
47
-
***Visualizations:**Graphics and charts can be generated from the code, using modules like Matplotlib, Plotly, Bokeh, and others. Similar to the output, these visualizations appear inline next to the code that generates them.
47
+
**Visualizations:**You can generate graphics and charts from the code by using modules like Matplotlib, Plotly, Bokeh, and others. Similar to the output, these visualizations appear inline next to the code that generates them. Similar to the output, these visualizations appear inline next to the code that generates them.
48
48
49
-
***Multimedia:** Because Jupyter notebook is built on the web technology, it can display all the types of multimedia supported in a web page. You can include them in a notebook as HTML elements, or you can generate them programmatically by using the `IPython.display` module.
49
+
**Multimedia:** Because Jupyter notebooks are built on web technology, they can display all the types of multimedia supported by a web page. You can include them in a notebook as HTML elements, or you can generate them programmatically by using the `IPython.display` module.
50
50
51
-
***Data:**Data from Azure Cosmos containers and results of queries can be imported into a Jupyter notebook programmatically. For example, you can use built-in commands to upload or query data in Azure Cosmos DB.
51
+
**Data:**You can import the data from Azure Cosmos containers or the results of queries into a Jupyter notebook programmatically. Use built-in magic commands to upload or query data in Azure Cosmos DB.
52
52
53
53
## Next steps
54
54
55
55
To get started with built-in Jupyter notebooks in Azure Cosmos DB, see the following articles:
56
56
57
57
*[Enable notebooks in an Azure Cosmos account](enable-notebooks.md)
58
58
*[Use Python notebook features and commands](use-python-notebook-features-and-commands.md)
59
-
*[Use C# notebook features and commands](use-csharp-notebook-features-and-commands.md)
60
-
61
-
62
-
59
+
*[Use C# notebook features and commands](use-csharp-notebook-features-and-commands.md)
Copy file name to clipboardExpand all lines: articles/cosmos-db/use-csharp-notebook-features-and commands.md
+11-11Lines changed: 11 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -23,10 +23,10 @@ In a new code cell, insert and run the following code, replacing ``PackageToBeIn
23
23
```
24
24
You can install multiple NuGet packages in the same cell. Packages will be available to use from any notebook in the Azure Cosmos account workspace.
25
25
26
-
Currently, the C# notebooks workspace does not support recursive resolution of NuGet packages. If a NuGet package has dependencies on other NuGet packages not currently installed, you may have to explicitly reference them along with the parent package.
26
+
Currently, the C# notebooks workspace does not support recursive resolution of NuGet packages. If a NuGet package has dependencies on other NuGet packages that are not currently installed, you have to explicitly reference them along with the parent package.
27
27
28
28
> [!TIP]
29
-
> If your notebook requires a custom package, we recommend that you add a cell to your notebook to install the package and make it the first cell. This reduces the chance of conflicts with any packages Azure Cosmos DB loads by default. It also makes it easy to re-install them if you [reset the workspace](#reset-notebooks-workspace), which removes all packages.
29
+
> If your notebook requires a custom package, we recommend that you add a cell to your notebook to install the package and make it the first cell. This reduces the chance of conflicts with other packages that Azure Cosmos DB loads by default. It is also easy to re-install the packages if you [reset the workspace](#reset-notebooks-workspace), which removes all packages.
30
30
31
31
## Use the built-in Azure Cosmos DB .NET SDK
32
32
Version 3 of the [Azure Cosmos DB .NET SDK for SQL API](https://github.com/Azure/azure-cosmos-dotnet-v3) is installed and included in the notebook environment for the Azure Cosmos account.
@@ -48,19 +48,19 @@ CosmosClient cosmosClient = new CosmosClient(Cosmos.Endpoint, Cosmos.Key);
See [.NET SDK samples](https://github.com/Azure/azure-cosmos-dotnet-v3/tree/master/Microsoft.Azure.Cosmos.Samples/Usage).
51
+
To learn more, see the [.NET V3 SDK samples](https://github.com/Azure/azure-cosmos-dotnet-v3/tree/master/Microsoft.Azure.Cosmos.Samples/Usage).
52
52
53
53
> [!IMPORTANT]
54
54
> The built-in Azure Cosmos DB .NET SDK is only supported for SQL (Core) API accounts. For other APIs, you will need to [install the relevant .NET driver](#install-a-new-nuget-package) that corresponds to the API.
55
55
56
56
## Set custom options using ```CosmosClientOptions```
57
-
For more flexibility, you can set custom ``CosmosClientOptions``to pass in your ``CosmosClient`` instance. You can use this to:
57
+
For more flexibility, you can set the custom ``CosmosClientOptions``property and pass it in your ``CosmosClient`` instance. You can use this property to:
58
58
59
-
- Set an application name in the user-agent suffix to include in every request
60
-
- Set the preferred region to be used to operations against the service
61
-
- Set a custom retry policy on rate-limited requests
59
+
- Set an application name in the user-agent suffix to include it in every request.
60
+
- Set the preferred region to be used when running operations against the service.
61
+
- Set a custom retry policy to handle rate-limited requests.
62
62
63
-
See the [documentation](/dotnet/api/microsoft.azure.cosmos.cosmosclientoptions) for all ``CosmosClientOptions``settings.
63
+
See the [CosmosClientOptions API reference](/dotnet/api/microsoft.azure.cosmos.cosmosclientoptions)article for all the supported settings. The following is an example that shows how to set `cosmosClientOptions` property:
64
64
65
65
```csharp
66
66
usingMicrosoft.Azure.Cosmos;
@@ -77,7 +77,7 @@ var client = new CosmosClient(Cosmos.Endpoint, Cosmos.Key, cosmosClientOptions);
77
77
```
78
78
79
79
## Access the account endpoint and primary key variables
80
-
You can access the built-in endpoint and key of the account your notebook is in.
80
+
You can access the built-in endpoint and key of the Azure Cosmos account where your notebook exists.
81
81
82
82
```csharp
83
83
varkey=Cosmos.Key;
@@ -105,9 +105,9 @@ for (int i = 0; i < 5; i++) {
105
105
> Console.WriteLine() syntax is not currently supported in C# notebooks. Use Display.AsMarkdown to print console output from your program.
106
106
107
107
## Use built-in nteract data explorer
108
-
You can use the built-in [nteract data explorer](https://blog.nteract.io/designing-the-nteract-data-explorer-f4476d53f897) to filter and visualize a collection of items. In a cell, put the variable you want to visualize in the last line, which will automatically be displayed in nteract when the cell is run.
108
+
You can use the built-in [nteract data explorer](https://blog.nteract.io/designing-the-nteract-data-explorer-f4476d53f897) to filter and visualize a collection of items. In a cell, put the variable you want to visualize in the last line, which is automatically displayed in nteract when you run the cell.
109
109
110
-
For example, in the GetingStarted_Csharp.ipynb example, we can print out the variable with our result, the ``telemetryEvents``. See the [GettingStarted_Csharp.ipynb notebook](https://github.com/Azure-Samples/cosmos-notebooks/blob/master/CSharp_quickstarts/GettingStarted_CSharp.ipynb) for the entire sample.
110
+
For example, in the *GetingStarted_Csharp.ipynb* example, we can print out the variable with our result, the ``telemetryEvents``. See the [GettingStarted_Csharp.ipynb notebook](https://github.com/Azure-Samples/cosmos-notebooks/blob/master/CSharp_quickstarts/GettingStarted_CSharp.ipynb) for the entire sample.
0 commit comments