Skip to content

Commit

Permalink
Update 01.Jupyter Notebook And .NET Interactive.ipynb
Browse files Browse the repository at this point in the history
  • Loading branch information
chuongmep committed Feb 27, 2024
1 parent 80624e4 commit 3e40aa8
Showing 1 changed file with 68 additions and 7 deletions.
75 changes: 68 additions & 7 deletions docs/Tutorials/01.Jupyter Notebook And .NET Interactive.ipynb
Original file line number Diff line number Diff line change
@@ -1,8 +1,67 @@
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Introduction"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
".NET Interactive is a group of CLI tools and APIs that enable users to create interactive experiences across the web, markdown, and notebooks such as Jupyter.\n",
"\n",
"In the context of Jupyter notebooks, .NET Interactive allows you to use .NET languages like C# and F# for data exploration and interactive scripting. You can write code in cells and execute them in order, and the output is displayed beneath each cell. This is particularly useful for data analysis, machine learning, scientific computing, and tutorial / teaching purposes.\n",
"\n",
"To use .NET Interactive with Jupyter notebooks, you need to install the .NET Interactive global tool and then install the .NET kernel for Jupyter. Once installed, you can select the .NET kernel in your Jupyter notebook and start writing .NET code.\n",
"\n",
"Here's an example of a simple C# code in a Jupyter notebook cell:\n",
"\n"
]
},
{
"cell_type": "code",
"execution_count": 1,
"execution_count": 3,
"metadata": {
"vscode": {
"languageId": "polyglot-notebook"
}
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Hello, .NET Interactive!\r\n"
]
}
],
"source": [
"var helloMessage = \"Hello, .NET Interactive!\";\n",
"Console.WriteLine(helloMessage);"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"\n",
"\n",
"When you run this cell, it will display the message \"Hello, .NET Interactive!\" beneath it."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Let's try install nuget APSToolkit"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {
"dotnet_interactive": {
"language": "csharp"
Expand All @@ -16,15 +75,17 @@
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Hello, World!\r\n"
]
"data": {
"text/html": [
"<div><div></div><div></div><div><strong>Installed Packages</strong><ul><li><span>APSToolkit, 1.0.4</span></li></ul></div></div>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"Console.WriteLine(\"Hello, World!\");"
"#r \"nuget:APSToolkit\""
]
}
],
Expand Down

0 comments on commit 3e40aa8

Please sign in to comment.