solorice/vscode/extensions/ms-toolsai.jupyter-2022.3.1000901801/pythonFiles/Notebooks intro.ipynb
2022-04-28 20:54:44 +03:00

204 lines
16 KiB
Plaintext

{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Creating a new notebook\n",
"\n",
"<style type=\"text/css\">\n",
".border {\n",
" display: inline-block;\n",
" border: solid 1px rgba(204, 204, 204, 0.4);\n",
" border-bottom-color: rgba(187, 187, 187, 0.4);\n",
" border-radius: 3px;\n",
" box-shadow: inset 0 -1px 0 rgba(187, 187, 187, 0.4);\n",
" background-color: inherit !important;\n",
" vertical-align: middle;\n",
" color: inherit !important;\n",
" font-size: 11px;\n",
" padding: 3px 5px;\n",
" margin: 0 2px;\n",
" }\n",
"</style>\n",
"\n",
"1. <p>Open the command palette with the shortcut: ",
" <span style=\"line-height: 10px;\">\n",
" <span class=\"border\">Ctrl/Command</span>\n",
" <span>+</span>\n",
" <span class=\"border\">Shift</span>\n",
" <span>+</span>\n",
" <span class=\"border\">P</span>\n",
" </span></p>\n",
"\n",
"2. <p>Search for the command <code>Create New Blank Notebook</code></p>\n",
"\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"---\n",
"# How to get back to the start page\n",
"\n",
"1. <p>Open the command palette with the shortcut:\n",
" <span style=\"line-height: 10px;\">\n",
" <span class=\"border\">Ctrl/Command</span>\n",
" <span>+</span>\n",
" <span class=\"border\">Shift</span>\n",
" <span>+</span>\n",
" <span class=\"border\">P</span>\n",
" </span></p>\n",
"\n",
"2. <p>Search for the command <code>Python: Open Start Page</code></p>\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"---\n",
"# Getting started\n",
"\n",
"You are currently viewing what we call our Notebook Editor. It is an interactive document based on Jupyter Notebooks that supports the intermixing of code, outputs and markdown documentation. \n",
"\n",
"This cell is a markdown cell. To edit the text in this cell, simply double click on the cell to change it into edit mode.\n",
"\n",
"<p>The next cell below is a code cell. You can switch a cell between code and markdown by clicking on the code <svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n",
"<path style=\"fill: currentColor !important; fill-rule: evenodd !important; clip-rule: evenodd !important\" d=\"M6 2.98361V2.97184V2H5.91083C5.59743 2 5.29407 2.06161 5.00128 2.18473C4.70818 2.30798 4.44942 2.48474 4.22578 2.71498C4.00311 2.94422 3.83792 3.19498 3.73282 3.46766L3.73233 3.46898C3.63382 3.7352 3.56814 4.01201 3.53533 4.29917L3.53519 4.30053C3.50678 4.5805 3.4987 4.86844 3.51084 5.16428C3.52272 5.45379 3.52866 5.74329 3.52866 6.03279C3.52866 6.23556 3.48974 6.42594 3.412 6.60507L3.4116 6.60601C3.33687 6.78296 3.23423 6.93866 3.10317 7.07359C2.97644 7.20405 2.82466 7.31055 2.64672 7.3925C2.4706 7.46954 2.28497 7.5082 2.08917 7.5082H2V7.6V8.4V8.4918H2.08917C2.28465 8.4918 2.47001 8.53238 2.64601 8.61334L2.64742 8.61396C2.82457 8.69157 2.97577 8.79762 3.10221 8.93161L3.10412 8.93352C3.23428 9.0637 3.33659 9.21871 3.41129 9.39942L3.41201 9.40108C3.48986 9.58047 3.52866 9.76883 3.52866 9.96721C3.52866 10.2567 3.52272 10.5462 3.51084 10.8357C3.4987 11.1316 3.50677 11.4215 3.53516 11.7055L3.53535 11.7072C3.56819 11.9903 3.63387 12.265 3.73232 12.531L3.73283 12.5323C3.83793 12.805 4.00311 13.0558 4.22578 13.285C4.44942 13.5153 4.70818 13.692 5.00128 13.8153C5.29407 13.9384 5.59743 14 5.91083 14H6V13.2V13.0164H5.91083C5.71095 13.0164 5.52346 12.9777 5.34763 12.9008C5.17396 12.8191 5.02194 12.7126 4.89086 12.5818C4.76386 12.4469 4.66104 12.2911 4.58223 12.1137C4.50838 11.9346 4.47134 11.744 4.47134 11.541C4.47134 11.3127 4.4753 11.0885 4.48321 10.8686C4.49125 10.6411 4.49127 10.4195 4.48324 10.2039C4.47914 9.98246 4.46084 9.76883 4.42823 9.56312C4.39513 9.35024 4.33921 9.14757 4.26039 8.95536C4.18091 8.76157 4.07258 8.57746 3.93616 8.40298C3.82345 8.25881 3.68538 8.12462 3.52283 8C3.68538 7.87538 3.82345 7.74119 3.93616 7.59702C4.07258 7.42254 4.18091 7.23843 4.26039 7.04464C4.33913 6.85263 4.39513 6.65175 4.42826 6.44285C4.46082 6.2333 4.47914 6.01973 4.48324 5.80219C4.49127 5.58262 4.49125 5.36105 4.48321 5.13749C4.4753 4.9134 4.47134 4.68725 4.47134 4.45902C4.47134 4.26019 4.50833 4.07152 4.58238 3.89205C4.66135 3.71034 4.76421 3.55475 4.89086 3.42437C5.02193 3.28942 5.17461 3.18275 5.34802 3.10513C5.5238 3.02427 5.71113 2.98361 5.91083 2.98361H6ZM10 13.0164V13.0282V14H10.0892C10.4026 14 10.7059 13.9384 10.9987 13.8153C11.2918 13.692 11.5506 13.5153 11.7742 13.285C11.9969 13.0558 12.1621 12.805 12.2672 12.5323L12.2677 12.531C12.3662 12.2648 12.4319 11.988 12.4647 11.7008L12.4648 11.6995C12.4932 11.4195 12.5013 11.1316 12.4892 10.8357C12.4773 10.5462 12.4713 10.2567 12.4713 9.96721C12.4713 9.76444 12.5103 9.57406 12.588 9.39493L12.5884 9.39399C12.6631 9.21704 12.7658 9.06134 12.8968 8.92642C13.0236 8.79595 13.1753 8.68945 13.3533 8.6075C13.5294 8.53046 13.715 8.4918 13.9108 8.4918H14V8.4V7.6V7.5082H13.9108C13.7153 7.5082 13.53 7.46762 13.354 7.38666L13.3526 7.38604C13.1754 7.30844 13.0242 7.20238 12.8978 7.06839L12.8959 7.06648C12.7657 6.9363 12.6634 6.78129 12.5887 6.60058L12.588 6.59892C12.5101 6.41953 12.4713 6.23117 12.4713 6.03279C12.4713 5.74329 12.4773 5.45379 12.4892 5.16428C12.5013 4.86842 12.4932 4.57848 12.4648 4.29454L12.4646 4.29285C12.4318 4.00971 12.3661 3.73502 12.2677 3.46897L12.2672 3.46766C12.1621 3.19499 11.9969 2.94422 11.7742 2.71498C11.5506 2.48474 11.2918 2.30798 10.9987 2.18473C10.7059 2.06161 10.4026 2 10.0892 2H10V2.8V2.98361H10.0892C10.2891 2.98361 10.4765 3.0223 10.6524 3.09917C10.826 3.18092 10.9781 3.28736 11.1091 3.41823C11.2361 3.55305 11.339 3.70889 11.4178 3.88628C11.4916 4.0654 11.5287 4.25596 11.5287 4.45902C11.5287 4.68727 11.5247 4.91145 11.5168 5.13142C11.5088 5.35894 11.5087 5.58049 11.5168 5.79605C11.5209 6.01754 11.5392 6.23117 11.5718 6.43688C11.6049 6.64976 11.6608 6.85243 11.7396 7.04464C11.8191 7.23843 11.9274 7.42254 12.0638 7.59702C12.1765 7.74119 12.3146 7.87538 12.4772 8C12.3146 8.12462 12.1765 8.25881 12.0638 8.40298C11.9274 8.57746 11.8191 8.76157 11.7396 8.95536C11.6609 9.14737 11.6049 9.34825 11.5717 9.55715C11.5392 9.7667 11.5209 9.98027 11.5168 10.1978C11.5087 10.4174 11.5087 10.6389 11.5168 10.8625C11.5247 11.0866 11.5287 11.3128 11.5287 11.541C11.5287 11.7398 11.4917 11.9285 11.4176 12.1079C11.3386 12.2897 11.2358 12.4452 11.1091 12.5756C10.9781 12.7106 10.8254 12.8173 10.652 12.8949C10.4762 12.9757 10.2889 13.0164 10.0892 13.0164H10Z\"/>\n",
"</svg>/markdown <svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n",
"<path style=\"fill: currentColor !important;\" d=\"M5.76758 10.3789C5.82227 10.2227 5.87695 10.0684 5.93164 9.91602C5.99023 9.75977 6.05273 9.60742 6.11914 9.45898L8.42188 4.25H9.5V11.75H8.64453V6.7168C8.64453 6.4707 8.65039 6.22852 8.66211 5.99023C8.67383 5.74805 8.68555 5.50391 8.69727 5.25781C8.66602 5.37891 8.63281 5.50195 8.59766 5.62695C8.56641 5.75195 8.52539 5.87109 8.47461 5.98438L5.96094 11.75H5.53906L3.03125 6.03125C2.97656 5.91016 2.93164 5.7832 2.89648 5.65039C2.86523 5.51758 2.83008 5.38672 2.79102 5.25781C2.81055 5.50391 2.82227 5.75 2.82617 5.99609C2.83008 6.23828 2.83203 6.48242 2.83203 6.72852V11.75H2V4.25H3.13672L5.39844 9.48242C5.46094 9.62695 5.52344 9.77539 5.58594 9.92773C5.64844 10.0762 5.69727 10.2266 5.73242 10.3789H5.76758ZM13.8887 10.1387L12.125 11.9023L10.3613 10.1387L10.8887 9.61133L11.75 10.4668V4.25H12.5V10.4668L13.3613 9.61133L13.8887 10.1387Z\"/>\n",
"</svg> icons or using the keyboard shortcut\n",
" <span style=\"line-height: 10px;\">\n",
" <span class=\"border\">M</span>\n",
" </span>\n",
"and\n",
" <span style=\"line-height: 10px;\">\n",
" <span class=\"border\">Y</span>\n",
" </span>\n",
"respectively.</p>\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"print('hello world')"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"* <p>To execute the code in the cell above, click on the cell to select it and then either press the play <svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n",
"<path style=\"fill: #388A34 !important; fill-rule: evenodd !important; clip-rule: evenodd !important\" d=\"M3.99977 14V2.18091L12.9998 8.06215L3.99977 14ZM5.5 4.99997L10.3145 8.06215L5.5 11.1809L5.5 4.99997Z\"/>\n",
"</svg>\n",
" button in the cell toolbar, or use the keyboard shortcut\n",
" <span style=\"line-height: 10px;\">\n",
" <span class=\"border\">Ctrl/Command</span>\n",
" <span>+</span>\n",
" <span class=\"border\">Enter</span>\n",
" </span>\n",
"</p>\n",
"* To edit the code, just click in cell and start editing.\n",
"* <p>To add a new cell below, click the <code>Add Cell</code> icon \n",
"<svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n",
"<path style=\"fill: currentColor !important;\" d=\"M14 7V8H8V14H7V8H1V7H7V1H8V7H14Z\"/>\n",
"</svg> \n",
"at the bottom left of the cell or enter command mode with the\n",
" <span style=\"line-height: 10px;\">\n",
" <span class=\"border\">ESC</span>\n",
" </span>\n",
"Key and then use the keyboard shortcut\n",
" <span style=\"line-height: 10px;\">\n",
" <span class=\"border\">B</span>\n",
" </span>\n",
"to create the new cell below.</p>\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"---\n",
"# Features\n",
"\n",
"**Variable explorer**\n",
"\n",
"<p>To view all your active variables and their current values in the notebook, click on the variable explorer icon \n",
"<svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n",
"<path style=\"fill: currentColor !important;\" d=\"M2.75 3.5H12.5V12.5H2.75V3.5ZM6.5 8V9.5H8.75V8H6.5ZM8.75 7.25V5.75H6.5V7.25H8.75ZM5.75 7.25V5.75H3.5V7.25H5.75ZM3.5 8V9.5H5.75V8H3.5ZM5.75 11.75V10.25H3.5V11.75H5.75ZM8.75 11.75V10.25H6.5V11.75H8.75ZM11.75 11.75V10.25H9.5V11.75H11.75ZM11.75 9.5V8H9.5V9.5H11.75ZM11.75 7.25V5.75H9.5V7.25H11.75ZM3.5 5H11.75V4.25H3.5V5Z\"/>\n",
"</svg>\n",
"in the top toolbar.</p>\n",
"\n",
"<img src=\"https://raw.githubusercontent.com/microsoft/vscode-jupyter/main/images/variableexplorer.png\" width=\"638\" height=\"318\" />\n",
"\n",
"**Data Viewer**\n",
"\n",
"<p>To view your data frame in a more visual \"Excel\" like format, open the variable explorer and to the left of any dataframe object, you will see the data viewer icon\n",
"<svg width=\"12\" height=\"12\" viewBox=\"0 0 12 12\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n",
"<path style=\"fill: currentColor !important;\" d=\"M12 0V9.75H9.75V12H0V2.25H2.25V0H12ZM11.25 9V0.75H3V2.25H4.5V3H0.75V11.25H9V7.5H9.75V9H11.25ZM5.51367 7.01367L4.98633 6.48633L8.4668 3H6V2.25H9.75V6H9V3.5332L5.51367 7.01367Z\"/>\n",
"</svg>\n",
"which you can click to open the data viewer.<p>\n",
"\n",
"<img src=\"https://raw.githubusercontent.com/microsoft/vscode-jupyter/main/images/dataviewer.gif\" width=\"638\" height=\"318\" />\n",
"\n",
"**Convert to Python File**\n",
"\n",
"<p>To export your notebook to a Python file (.py), click on the <code>Convert to Python script</code> icon \n",
"<svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n",
"<path style=\"fill: currentColor !important;\" d=\"M11 7.394L13.0177 9.41086L12.4109 10.0169L11.4286 9.03457V12.2857H8V11.4286H10.5714V9.03457L9.58914 10.0169L8.98229 9.41086L11 7.394ZM14 3.53686V8.85714H13.1429V4.57143H11.4286V2.85714H9.71429V8H8.85714V2H12.4631L14 3.53686ZM12.9654 3.71429L12.2857 3.03457V3.71429H12.9654ZM2 12.2857H7.14286V11.4286H2V12.2857ZM2 14H7.14286V13.1429H2V14ZM2 10.5714H7.14286V9.71429H2V10.5714Z\"/>\n",
"<path style=\"fill: #007ACC !important;\" d=\"M11 7.38538L13.0177 9.40223L12.4109 10.0082L11.4286 9.02595V12.2771H8V11.4199H10.5714V9.02595L9.58914 10.0082L8.98229 9.40223L11 7.38538Z\"/>\n",
"</svg>\n",
"in the top toolbar \n",
"</p>\n",
"\n",
"<img src=\"https://raw.githubusercontent.com/microsoft/vscode-jupyter/main/images/savetopythonfile.png\" width=\"638\" height=\"113\" />\n",
"\n",
"**Plot Viewer**\n",
"\n",
"<p>If you have a graph (such as matplotlib) in your output, you'll notice if you hover over the graph, the <code>Plot Viewer</code> icon \n",
"<svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n",
"<path style=\"fill: currentColor !important;\" d=\"M9.71429 6.28571V12.2857H7.14286V6.28571H9.71429ZM13.1429 2.85714V12.2857H10.5714V2.85714H13.1429ZM2.85714 13.1429H14V14H2V2H2.85714V13.1429ZM6.28571 4.57143V12.2857H3.71429V4.57143H6.28571Z\"/>\n",
"</svg>\n",
"will appear in the top left. Click the icon to open up the graph in the Plotviewer which allows you to zoom on your plots and export it in formats such as png and jpeg.</p>\n",
"\n",
"<img src=\"https://raw.githubusercontent.com/microsoft/vscode-jupyter/main/images/plotviewer.gif\" width=\"638\" height=\"318\" />\n",
"\n",
"**Switching Kernels**\n",
"\n",
"The notebook editor will detect all kernels in your system by default. To change your notebook kernel, click on the kernel status in the top toolbar at the far right. For example, your kernel status may say \"Python 3: Idle\". This will open up the kernel selector where you can choose your desired kernel.\n",
"\n",
"<img src=\"https://raw.githubusercontent.com/microsoft/vscode-jupyter/main/images/kernelchange.gif\" width=\"638\" height=\"318\" />\n",
"\n",
"**Remote Jupyter Server**\n",
"\n",
"<p>To connect to a remote Jupyter server, open the command prompt and search for the command <code>Specify remote or local Jupyter server for connections</code>. Then select <code>Existing</code> and enter the remote Jupyter server URL. Afterwards, you'll be prompted to reload the window and the Notebook will be opened connected to the remote Jupyter server.</p>\n",
"\n",
"<img src=\"https://raw.githubusercontent.com/microsoft/vscode-jupyter/main/images/remoteserver.gif\" width=\"638\" height=\"318\" />",
"\n"
]
},
{
"cell_type": "markdown",
"metadata": {
"colab_type": "text",
"id": "-Rh3-Vt9Nev9"
},
"source": [
"---\n",
"## More Resources\n",
"\n",
"- [Data science tutorial for Visual Studio Code](https://code.visualstudio.com/docs/python/data-science-tutorial)\n",
"- [Jupyter Notebooks in Visual Studio Code documentation](https://code.visualstudio.com/docs/python/jupyter-support)\n"
]
}
],
"metadata": {},
"nbformat": 4,
"nbformat_minor": 0
}