Skip to content

Commit 6f9bd1a

Browse files
authored
Merge pull request #115383 from deborahc/dech-notebook-docs
New documentation for C# notebooks
2 parents 08a6b10 + cbac230 commit 6f9bd1a

9 files changed

+253
-76
lines changed

.openpublishing.redirection.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2453,6 +2453,11 @@
24532453
"redirect_url": "/azure/cosmos-db/autoscale-faq",
24542454
"redirect_document_id": true
24552455
},
2456+
{
2457+
"source_path": "articles/cosmos-db/use-notebook-features-and-commands.md",
2458+
"redirect_url": "/azure/cosmos-db/use-python-notebook-features-and-commands",
2459+
"redirect_document_id": true
2460+
},
24562461
{
24572462
"source_path": "articles/cosmos-db/how-to-custom-synchronization.md",
24582463
"redirect_url": "/azure/cosmos-db/how-to-multi-master",

articles/cosmos-db/TOC.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1039,8 +1039,10 @@
10391039
items:
10401040
- name: Enable notebooks
10411041
href: enable-notebooks.md
1042-
- name: Use built-in notebook commands
1043-
href: use-notebook-features-and-commands.md
1042+
- name: Use built-in Python notebook commands
1043+
href: use-python-notebook-features-and-commands.md
1044+
- name: Use built-in C# notebook commands
1045+
href: use-csharp-notebook-features-and-commands.md
10441046
- name : Server-side programming
10451047
items:
10461048
- name: Write stored procedures, triggers, and UDFs

articles/cosmos-db/cosmosdb-jupyter-notebooks.md

Lines changed: 23 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -3,58 +3,57 @@ title: Introduction to the built-in Jupyter notebooks support in Azure Cosmos DB
33
description: Learn how you can use the built-in Jupyter notebooks support in Azure Cosmos DB to interactively run queries.
44
ms.service: cosmos-db
55
ms.topic: overview
6-
ms.date: 09/22/2019
7-
author: markjbrown
8-
ms.author: mjbrown
6+
ms.date: 05/19/2020
7+
author: deborahc
8+
ms.author: dech
99
---
1010

1111
# Built-in Jupyter notebooks support in Azure Cosmos DB (preview)
1212

13-
Jupyter notebook is an open-source web application that allows you to create and share documents containing live code, equations, visualizations, and narrative text. Azure Cosmos DB supports built-in Jupyter notebooks for all APIs such as Cassandra, MongoDB, SQL, Gremlin, and Table. The built-in notebook support for all Azure Cosmos DB APIs and data models allows you to interactively run queries. The Jupyter notebooks run within the Azure Cosmos accounts and they enable developers to perform data exploration, data cleaning, data transformations, numerical simulations, statistical modeling, data visualization, and machine learning.
13+
Jupyter notebook is an open-source web application that allows you to create and share documents that contain live code, equations, visualizations, and narrative text.
14+
15+
Azure Cosmos DB built-in Jupyter notebooks are directly integrated into the Azure portal and your Azure Cosmos DB accounts, making them convenient and easy to use. Developers, data scientists, engineers, and analysts can use the familiar Jupyter notebooks experience to do data exploration, data cleaning, data transformations, numerical simulations, statistical modeling, data visualization, and machine learning.
1416

1517
![Jupyter notebooks visualizations in Azure Cosmos DB](./media/cosmosdb-jupyter-notebooks/cosmos-notebooks-overview.png)
1618

17-
The Jupyter notebooks supports magic functions that extend the capabilities of the kernel by supporting additional commands. Cosmos magic is a command that extends the capabilities of the Python kernel in Jupyter notebook so you can run Azure Cosmos SQL API queries in addition to Apache Spark. You can easily combine Python and SQL API queries to query and visualize data by using rich visualization libraries integrated with render commands.
18-
Azure portal natively integrates Jupyter notebook experience into Azure Cosmos accounts as shown in the following image:
19+
Azure Cosmos DB supports both C# and Python notebooks for all APIs, including Core (SQL), Cassandra, Gremlin, Table, and API for MongoDB. Inside the notebook, you can take advantage of built-in commands and features that make it easy to create Azure Cosmos DB resources, upload data, and query and visualize your data in Azure Cosmos DB.
1920

2021
![Jupyter notebooks support in Azure Cosmos DB](./media/cosmosdb-jupyter-notebooks/jupyter-notebooks-portal.png)
2122

2223
## Benefits of Jupyter notebooks
2324

24-
Jupyter notebooks were originally developed for data science applications written in Python, R. However, they can be used in various ways for different kinds of projects such as:
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:
2526

26-
* ***Data visualizations:** Jupyter notebooks allow you to visualize data in the form of a shared notebook that renders some data set as a graphic. Jupyter notebook lets you author visualizations, share them, and allow interactive changes to the shared code and data set.
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.
2728

28-
* **Code sharing:** Services like GitHub provide ways to share code, but theyre 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.
2930

30-
* **Live interactions with code:** Jupyter notebook code is dynamic; it can be edited and re-run incrementally in real time. Notebooks can also embed user controls (e.g., 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).
3132

32-
* **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 in Azure Cosmos DB, with real-time output all along the way, you could embed it in a Jupyter Notebook. The code will remain fully functional. 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.
3334

34-
* **Cosmos magic commands:** In Jupyter notebooks, you can use custom magic commands for Azure Cosmos DB to make interactive computing easier. For example, the %%sql magic that allows one to query a Cosmos container using SQL API directly in a notebook.
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.
3536

36-
* **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.
3738

3839
## Components of a Jupyter notebook
3940

40-
Jupyter notebooks can include several types of components, each organized into discrete blocks:
41+
Jupyter notebooks can include several types of components, each organized into discrete blocks or cells:
4142

42-
* **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.
4344

44-
* **Code and output:** Jupyter notebooks support Python 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.
4546

46-
* **Visualizations:** Graphics and charts can be generated from the code, using modules like Matplotlib, Plotly, or Bokeh. 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.
4748

48-
* **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.
4950

50-
* **Data:** Data from Azure Cosmos containers and results of the queries can be imported into a Jupyter notebook programmatically. For example, by including code in the notebook to query the data using any of the Cosmos DB APIs or natively built-in Apache Spark.
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.
5152

5253
## Next steps
5354

54-
To get started with built-in Jupyter notebooks in Azure Cosmos DB see the following articles:
55+
To get started with built-in Jupyter notebooks in Azure Cosmos DB, see the following articles:
5556

5657
* [Enable notebooks in an Azure Cosmos account](enable-notebooks.md)
57-
* [Use notebook features and commands](use-notebook-features-and-commands.md)
58-
59-
60-
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)

articles/cosmos-db/create-notebook-visualize-data.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ In this section, you will create the Azure Cosmos database, container, and impor
2929

3030
1. After a new notebook is created, you can rename it to something like **VisualizeRetailData.ipynb.**
3131

32-
1. Next you will create a database named RetailDemo and a container named WebsiteData to store the retail data. You can use /CardID as the partition key. Copy and paste the following code to a new cell in your notebook and run it:
32+
1. Next you will create a database named "RetailDemo" and a container named "WebsiteData" to store the retail data. You can use /CartID as the partition key. Copy and paste the following code to a new cell in your notebook and run it:
3333

3434
```python
3535
import azure.cosmos
@@ -49,8 +49,8 @@ In this section, you will create the Azure Cosmos database, container, and impor
4949
The database and container are created in your current Azure Cosmos account. The container is provisioned with 400 RU/s. You will see the following output after the database and container is created.
5050

5151
```console
52-
Database RetailDemo created
53-
Container WebsiteData created
52+
Database RetailDemo created
53+
Container WebsiteData created
5454
```
5555

5656
You can also refresh the **Data** tab and see the newly created resources:
@@ -116,7 +116,7 @@ Before running queries to analyze the data, you can read the data from container
116116
{Query text}
117117
```
118118

119-
To learn more, see the [built-in notebook commands and features in Azure Cosmos DB](use-notebook-features-and-commands.md) article. You will run the query- `SELECT c.Action, c.Price as ItemRevenue, c.Country, c.Item FROM c`. The results will be saved into a Pandas DataFrame named df_cosmos. Paste the following command in a new notebook cell and run it:
119+
To learn more, see the [built-in notebook commands and features in Azure Cosmos DB](use-python-notebook-features-and-commands.md) article. You will run the query- `SELECT c.Action, c.Price as ItemRevenue, c.Country, c.Item FROM c`. The results will be saved into a Pandas DataFrame named df_cosmos. Paste the following command in a new notebook cell and run it:
120120

121121
```python
122122
%%sql --database RetailDemo --container WebsiteData --output df_cosmos
@@ -232,7 +232,7 @@ In this section, you will run some queries on the data retrieved.
232232

233233
![Countries revenue map visualization](./media/create-notebook-visualize-data/countries-revenue-map-visualization.png)
234234

235-
1. Lets see another case of data visualization. The WebsiteData container has record of users who viewed an item, added to their cart, and purchased the item. Lets plot the conversion rate of items purchased. Run the following code in a new cell to visualize the conversion rate for each item:
235+
1. Let's see another case of data visualization. The WebsiteData container has record of users who viewed an item, added to their cart, and purchased the item. Let's plot the conversion rate of items purchased. Run the following code in a new cell to visualize the conversion rate for each item:
236236

237237
```python
238238
from bokeh.io import show, output_notebook
@@ -285,4 +285,4 @@ In this section, you will run some queries on the data retrieved.
285285

286286
## Next steps
287287

288-
* To learn more about notebook commands, see [how to use built-in notebook commands and features in Azure Cosmos DB](use-notebook-features-and-commands.md) article.
288+
* To learn more about Python notebook commands, see [how to use built-in notebook commands and features in Azure Cosmos DB](use-python-notebook-features-and-commands.md) article.
56.1 KB
Loading
70.3 KB
Loading
112 KB
Loading

0 commit comments

Comments
 (0)