{"id":13,"date":"2019-02-07T16:00:33","date_gmt":"2019-02-07T13:00:33","guid":{"rendered":"http:\/\/www.etemkeskin.com\/?p=13"},"modified":"2020-11-15T22:55:53","modified_gmt":"2020-11-15T19:55:53","slug":"jupyter-notebook-shortcuts-and-most-used-code-snippets-for-beginners","status":"publish","type":"post","link":"https:\/\/www.etemkeskin.com\/index.php\/2019\/02\/07\/jupyter-notebook-shortcuts-and-most-used-code-snippets-for-beginners\/","title":{"rendered":"JUPYTER NOTEBOOK SHORTCUTS AND MOST USED CODE SNIPPETS FOR BEGINNERS"},"content":{"rendered":"\n<p>I have summarized the Jupyter Notebook shortcuts and the most used code snippets below that will save your time while using Jupyter notebook.<\/p>\n\n\n\n<p><strong>Shortcuts<\/strong><\/p>\n\n\n\n<p>These shortcuts are for Jupyter Notebook <strong>version 5.6.0<\/strong>.<\/p>\n\n\n\n<p><strong>Command mode and Edit mode<\/strong><\/p>\n\n\n\n<p><strong>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 <\/strong>When using shortcuts, it is necessary to pay attention to whether the notebook is command or editing mode.<\/p>\n\n\n\n<p>1. Command mode: <\/p>\n\n\n\n<p>2. Edit mode: <\/p>\n\n\n\n<p><strong>Command Mod<\/strong>e<\/p>\n\n\n\n<ul><li><strong>shift\u00a0+\u00a0enter<\/strong>\u00a0executes cell and selects the cell below.<\/li><li><strong>ctrl\u00a0+\u00a0enter<\/strong>\u00a0executes cell.<\/li><li><strong>alt\u00a0+\u00a0enter<\/strong>\u00a0executes cell, adds a cell below the selected cell and tab is active in.<\/li><li><strong>A<\/strong>\u00a0 adds a cell above the selected cell.<\/li><li><strong>B<\/strong>\u00a0 adds a cell below the selected cell.<\/li><li><strong>C<\/strong>\u00a0 copies cell.<\/li><li><strong>V<\/strong>\u00a0 paste cell.<\/li><li><strong>D<\/strong>\u00a0,\u00a0Pressing <strong>D<\/strong> 2 times deletes the selected cell.<\/li><li><strong>shift\u00a0+\u00a0M<\/strong>\u00a0Hold down <strong>shift<\/strong>, select cells, and then press <strong>M<\/strong>, cells are merged.<\/li><li><strong>I<\/strong>\u00a0,\u00a0If <strong>I<\/strong> is pressed 2 times consecutively, the kernel stops.<\/li><li><strong>0<\/strong>\u00a0,\u00a0Restarts the kernel with the dialog box.<\/li><li><strong>Y<\/strong>\u00a0, returns the cell to code mode.<\/li><li><strong>M<\/strong>,\u00a0returns the cell to markdown mode.<\/li><\/ul>\n\n\n\n<p><strong>Edit Mode<\/strong><\/p>\n\n\n\n<ul><li><strong>ctrl\u00a0+\u00a0click\u00a0<\/strong>\u00a0\u00a0\u00a0\u00a0 Multiple editing can be done by holding down <strong>ctrl<\/strong> and selecting multiple cursors with the mouse.<\/li><li><strong>ctrl<\/strong>\u00a0+\u00a0<strong>\/\u00a0<\/strong>\u00a0\u00a0 \u00a0\u00a0\u00a0\u00a0If <strong>ctrl <\/strong>is pressed and the lines to be commented are selected <strong>&#8220;\/&#8221;<\/strong> pressed, collective comments are made.\u00a0<\/li><li><strong>tab<\/strong>\u00a0 to complete and indent code<\/li><\/ul>\n\n\n\n<p><strong>NOTE :<\/strong><code> <strong>cmd +shift +\u00a0p<\/strong><\/code><strong>\u00a0<\/strong>\u00a0You can list all commands in Jupyter Notebook.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" width=\"700\" height=\"169\" src=\"http:\/\/www.etemkeskin.com\/wp-content\/uploads\/2019\/02\/jt_1.png\" alt=\"\" class=\"wp-image-19\"\/><\/figure>\n\n\n\n<p><strong>View all keyboard shortcuts<\/strong><\/p>\n\n\n\n<p>If you press <strong>H<\/strong> \u2018(in Command Mode), you can see what are the shortcuts on the keyboard.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" width=\"700\" height=\"256\" src=\"http:\/\/www.etemkeskin.com\/wp-content\/uploads\/2019\/02\/jt_2.png\" alt=\"\" class=\"wp-image-20\"\/><\/figure>\n\n\n\n<p><strong>Text snippets<\/strong><\/p>\n\n\n\n<p>Below are the text snippets you will use frequently while working on the notebook.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"python\" data-enlighter-theme=\"beyond\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"200\" data-enlighter-title=\"\" data-enlighter-group=\"\">from __future__ import division\n\nimport numpy as np\n\nimport pandas as pd\n\nfrom pandas import Series, DataFrame\n\nfrom numpy.random import randn\n\nfrom scipy import stats\n\nimport matplotlib as mpl\nimport matplotlib.pyplot as plt\nimport seaborn as sns\nsns.set_style('whitegrid')\n\n%matplotlib inline\n\nimport math\n\nfrom sklearn.linear_model import LogisticRegression\nfrom sklearn.linear_model import LinearRegression\nfrom sklearn.cross_validation import train_test_split\n\nfrom sklearn import metrics\n\nimport statsmodels.api as sm\n\nfrom pprint import pprint<\/pre>\n\n\n\n<p>Sources:<\/p>\n\n\n\n<figure class=\"wp-block-embed\"><div class=\"wp-block-embed__wrapper\">\nhttp:\/\/maxmelnick.com\/2016\/04\/19\/python-beginner-tips-and-tricks.html\n<\/div><\/figure>\n\n\n\n<pre class=\"wp-block-code\"><code><\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>I have summarized the Jupyter Notebook shortcuts and the most used code snippets below that will save your time while using Jupyter notebook. Shortcuts These shortcuts are for Jupyter Notebook version 5.6.0. Command mode and Edit mode \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 When using shortcuts, it is necessary to pay attention to whether the notebook is command or editing [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[4],"tags":[6,5],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v16.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>JUPYTER NOTEBOOK SHORTCUTS AND MOST USED CODE SNIPPETS FOR BEGINNERS - blog website<\/title>\n<meta name=\"description\" content=\"I have summarized the Jupyter Notebook shortcuts and the most used code snippets below that will save your time while using Jupyter notebook.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.etemkeskin.com\/index.php\/2019\/02\/07\/jupyter-notebook-shortcuts-and-most-used-code-snippets-for-beginners\/\" \/>\n<meta property=\"og:locale\" content=\"tr_TR\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"JUPYTER NOTEBOOK SHORTCUTS AND MOST USED CODE SNIPPETS FOR BEGINNERS - blog website\" \/>\n<meta property=\"og:description\" content=\"I have summarized the Jupyter Notebook shortcuts and the most used code snippets below that will save your time while using Jupyter notebook.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.etemkeskin.com\/index.php\/2019\/02\/07\/jupyter-notebook-shortcuts-and-most-used-code-snippets-for-beginners\/\" \/>\n<meta property=\"og:site_name\" content=\"blog website\" \/>\n<meta property=\"article:published_time\" content=\"2019-02-07T13:00:33+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2020-11-15T19:55:53+00:00\" \/>\n<meta property=\"og:image\" content=\"http:\/\/www.etemkeskin.com\/wp-content\/uploads\/2019\/02\/jt_1.png\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Tahmini okuma s\u00fcresi\" \/>\n\t<meta name=\"twitter:data1\" content=\"2 dakika\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.etemkeskin.com\/#website\",\"url\":\"https:\/\/www.etemkeskin.com\/\",\"name\":\"blog website\",\"description\":\"Etem KESK\\u0130N\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":\"https:\/\/www.etemkeskin.com\/?s={search_term_string}\",\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"tr\"},{\"@type\":\"ImageObject\",\"@id\":\"https:\/\/www.etemkeskin.com\/index.php\/2019\/02\/07\/jupyter-notebook-shortcuts-and-most-used-code-snippets-for-beginners\/#primaryimage\",\"inLanguage\":\"tr\",\"url\":\"http:\/\/www.etemkeskin.com\/wp-content\/uploads\/2019\/02\/jt_1.png\",\"contentUrl\":\"http:\/\/www.etemkeskin.com\/wp-content\/uploads\/2019\/02\/jt_1.png\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.etemkeskin.com\/index.php\/2019\/02\/07\/jupyter-notebook-shortcuts-and-most-used-code-snippets-for-beginners\/#webpage\",\"url\":\"https:\/\/www.etemkeskin.com\/index.php\/2019\/02\/07\/jupyter-notebook-shortcuts-and-most-used-code-snippets-for-beginners\/\",\"name\":\"JUPYTER NOTEBOOK SHORTCUTS AND MOST USED CODE SNIPPETS FOR BEGINNERS - blog website\",\"isPartOf\":{\"@id\":\"https:\/\/www.etemkeskin.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.etemkeskin.com\/index.php\/2019\/02\/07\/jupyter-notebook-shortcuts-and-most-used-code-snippets-for-beginners\/#primaryimage\"},\"datePublished\":\"2019-02-07T13:00:33+00:00\",\"dateModified\":\"2020-11-15T19:55:53+00:00\",\"author\":{\"@id\":\"https:\/\/www.etemkeskin.com\/#\/schema\/person\/dcbc30282861ce578b96a79ce8789629\"},\"description\":\"I have summarized the Jupyter Notebook shortcuts and the most used code snippets below that will save your time while using Jupyter notebook.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.etemkeskin.com\/index.php\/2019\/02\/07\/jupyter-notebook-shortcuts-and-most-used-code-snippets-for-beginners\/#breadcrumb\"},\"inLanguage\":\"tr\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.etemkeskin.com\/index.php\/2019\/02\/07\/jupyter-notebook-shortcuts-and-most-used-code-snippets-for-beginners\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.etemkeskin.com\/index.php\/2019\/02\/07\/jupyter-notebook-shortcuts-and-most-used-code-snippets-for-beginners\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Ana sayfa\",\"item\":\"https:\/\/www.etemkeskin.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"JUPYTER NOTEBOOK SHORTCUTS AND MOST USED CODE SNIPPETS FOR BEGINNERS\"}]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.etemkeskin.com\/#\/schema\/person\/dcbc30282861ce578b96a79ce8789629\",\"name\":\"etemkeskin\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\/\/www.etemkeskin.com\/#personlogo\",\"inLanguage\":\"tr\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/6af0148b790691ed24ae245fb3dc773b?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/6af0148b790691ed24ae245fb3dc773b?s=96&d=mm&r=g\",\"caption\":\"etemkeskin\"},\"url\":\"https:\/\/www.etemkeskin.com\/index.php\/author\/etemkeskinyahoo-com\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","_links":{"self":[{"href":"https:\/\/www.etemkeskin.com\/index.php\/wp-json\/wp\/v2\/posts\/13"}],"collection":[{"href":"https:\/\/www.etemkeskin.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.etemkeskin.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.etemkeskin.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.etemkeskin.com\/index.php\/wp-json\/wp\/v2\/comments?post=13"}],"version-history":[{"count":45,"href":"https:\/\/www.etemkeskin.com\/index.php\/wp-json\/wp\/v2\/posts\/13\/revisions"}],"predecessor-version":[{"id":492,"href":"https:\/\/www.etemkeskin.com\/index.php\/wp-json\/wp\/v2\/posts\/13\/revisions\/492"}],"wp:attachment":[{"href":"https:\/\/www.etemkeskin.com\/index.php\/wp-json\/wp\/v2\/media?parent=13"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.etemkeskin.com\/index.php\/wp-json\/wp\/v2\/categories?post=13"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.etemkeskin.com\/index.php\/wp-json\/wp\/v2\/tags?post=13"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}