{"id":2562,"date":"2026-02-02T11:01:39","date_gmt":"2026-02-02T11:01:39","guid":{"rendered":"https:\/\/demo.materiamedica.net\/demo6\/?p=2562"},"modified":"2026-02-02T11:01:39","modified_gmt":"2026-02-02T11:01:39","slug":"chapter-1-numpy-editor","status":"publish","type":"post","link":"https:\/\/demo.materiamedica.net\/demo6\/chapter-1-numpy-editor\/","title":{"rendered":"Chapter 1: NumPy Editor"},"content":{"rendered":"<p dir=\"auto\"><strong>NumPy Editor \/ IDE \/ Working Environment Guide<\/strong> written in the style of a patient, experienced teacher who is sitting next to you and helping you set up the most comfortable, productive, and beginner-friendly environment for learning and using NumPy seriously.<\/p>\n<p dir=\"auto\">We will cover <strong>everything you actually need<\/strong> \u2014 from installation to daily workflow, keyboard shortcuts, debugging tricks, visualization helpers, notebook best practices, and common pain points \u2014 so that you feel \u201cat home\u201d when writing NumPy code.<\/p>\n<h3 dir=\"auto\">1. Choose Your Main Working Environment (2025 realistic choices)<\/h3>\n<p dir=\"auto\">Most people use one of these four setups in 2025:<\/p>\n<div>\n<div dir=\"auto\">\n<table dir=\"auto\">\n<thead>\n<tr>\n<th data-col-size=\"lg\">Environment<\/th>\n<th data-col-size=\"lg\">Best for<\/th>\n<th data-col-size=\"sm\">Learning curve<\/th>\n<th data-col-size=\"xs\">Speed of feedback<\/th>\n<th data-col-size=\"lg\">Recommendation for NumPy beginners<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td data-col-size=\"lg\">Jupyter Notebook \/ Lab<\/td>\n<td data-col-size=\"lg\">Interactive exploration, teaching<\/td>\n<td data-col-size=\"sm\">very low<\/td>\n<td data-col-size=\"xs\">instant<\/td>\n<td data-col-size=\"lg\">\u2605\u2605\u2605\u2605\u2605 (start here)<\/td>\n<\/tr>\n<tr>\n<td data-col-size=\"lg\">VS Code + Jupyter extension<\/td>\n<td data-col-size=\"lg\">Long-term serious work, debugging<\/td>\n<td data-col-size=\"sm\">low\u2013medium<\/td>\n<td data-col-size=\"xs\">instant\u2013fast<\/td>\n<td data-col-size=\"lg\">\u2605\u2605\u2605\u2605\u2605 (move here after 1\u20133 months)<\/td>\n<\/tr>\n<tr>\n<td data-col-size=\"lg\">Google Colab<\/td>\n<td data-col-size=\"lg\">Zero installation, GPU\/TPU, sharing<\/td>\n<td data-col-size=\"sm\">very low<\/td>\n<td data-col-size=\"xs\">instant<\/td>\n<td data-col-size=\"lg\">\u2605\u2605\u2605\u2605\u2606 (great if you have no laptop)<\/td>\n<\/tr>\n<tr>\n<td data-col-size=\"lg\">PyCharm \/ DataSpell<\/td>\n<td data-col-size=\"lg\">Professional project, large codebase<\/td>\n<td data-col-size=\"sm\">medium<\/td>\n<td data-col-size=\"xs\">fast<\/td>\n<td data-col-size=\"lg\">\u2605\u2605\u2605\u2606\u2606 (later, when doing real projects)<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<div><\/div>\n<\/div>\n<\/div>\n<p dir=\"auto\"><strong>Teacher\u2019s honest recommendation for most learners in 2025:<\/strong><\/p>\n<ol dir=\"auto\">\n<li><strong>Start with JupyterLab<\/strong> (local) or <strong>Google Colab<\/strong> (cloud)<\/li>\n<li>After 1\u20133 months \u2192 switch to <strong>VS Code + Jupyter extension<\/strong> (best long-term balance of interactivity + serious coding)<\/li>\n<\/ol>\n<h3 dir=\"auto\">2. Option A \u2013 JupyterLab (local \u2013 most recommended)<\/h3>\n<h4 dir=\"auto\">Step-by-step installation (Windows \/ macOS \/ Linux)<\/h4>\n<div dir=\"auto\">\n<div data-testid=\"code-block\">\n<div>\n<div>Bash<\/div>\n<div>\n<pre tabindex=\"0\"><code># 1. Create clean environment (very important!)\r\npython -m venv numpy-env\r\nsource numpy-env\/bin\/activate     # macOS\/Linux\r\nnumpy-env\\Scripts\\activate        # Windows\r\n\r\n# 2. Install essentials\r\npip install --upgrade pip\r\npip install jupyterlab notebook ipywidgets matplotlib seaborn pandas numpy scipy\r\n\r\n# 3. Optional but very useful extensions\r\npip install jupyterlab-lsp jupyterlab-git rise\r\n\r\n# 4. Start JupyterLab\r\njupyter lab<\/code><\/pre>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<p dir=\"auto\">Open http:\/\/localhost:8888 in your browser \u2192 you\u2019re ready.<\/p>\n<h4 dir=\"auto\">Daily JupyterLab workflow tips (what experienced users actually do)<\/h4>\n<ul dir=\"auto\">\n<li><strong>Always start with magic commands<\/strong><\/li>\n<\/ul>\n<div dir=\"auto\">\n<div data-testid=\"code-block\">\n<div>\n<div>Python<\/div>\n<div>\n<pre tabindex=\"0\"><code>%matplotlib inline          # or %matplotlib widget for interactive plots\r\n%config InlineBackend.figure_format = 'retina'   # crisp plots on high-DPI screens\r\n\r\nimport numpy as np\r\nimport pandas as pd\r\nimport matplotlib.pyplot as plt\r\nimport seaborn as sns\r\n\r\nsns.set_theme(style=\"whitegrid\")<\/code><\/pre>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<ul dir=\"auto\">\n<li><strong>Useful magic commands<\/strong><\/li>\n<\/ul>\n<div dir=\"auto\">\n<div data-testid=\"code-block\">\n<div>\n<div>Python<\/div>\n<div>\n<pre tabindex=\"0\"><code>%timeit np.arange(1000000).sum()      # performance testing\r\n%whos                                 # see all variables + sizes\r\n%reset -f                             # clear namespace\r\n%loadpy my_script.py                  # load code from file<\/code><\/pre>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<ul dir=\"auto\">\n<li><strong>Quick variable explorer<\/strong> Install jupyterlab-variableInspector extension<\/li>\n<\/ul>\n<h3 dir=\"auto\">3. Option B \u2013 VS Code + Jupyter (my personal favorite for serious work)<\/h3>\n<h4 dir=\"auto\">Installation &amp; setup (5 minutes)<\/h4>\n<ol dir=\"auto\">\n<li>\n<p dir=\"auto\">Install VS Code<\/p>\n<\/li>\n<li>\n<p dir=\"auto\">Install these extensions (search in Extensions panel):<\/p>\n<ul dir=\"auto\">\n<li><strong>Jupyter<\/strong> (by Microsoft)<\/li>\n<li><strong>Python<\/strong> (by Microsoft)<\/li>\n<li><strong>Pylance<\/strong> (better autocompletion)<\/li>\n<li><strong>Jupyter Notebook Renderers<\/strong><\/li>\n<li><strong>Jupyter Keymap<\/strong> (optional \u2013 makes shortcuts feel like classic Jupyter)<\/li>\n<\/ul>\n<\/li>\n<li>\n<p dir=\"auto\">Create or open .ipynb file \u2192 VS Code automatically starts Jupyter kernel<\/p>\n<\/li>\n<\/ol>\n<h4 dir=\"auto\">My favorite VS Code + Jupyter workflow<\/h4>\n<ul dir=\"auto\">\n<li><strong>Ctrl+Enter<\/strong> \u2192 run current cell<\/li>\n<li><strong>Shift+Enter<\/strong> \u2192 run cell and go to next<\/li>\n<li><strong>Alt+Enter<\/strong> \u2192 run cell and insert new below<\/li>\n<li><strong>Ctrl+\/<\/strong> \u2192 comment \/ uncomment line(s)<\/li>\n<li><strong>F5<\/strong> or <strong>Run \u2192 Run All<\/strong> \u2192 run whole notebook<\/li>\n<li><strong>Outline panel<\/strong> (left sidebar) \u2192 jump between markdown &amp; code sections<\/li>\n<li><strong>Variable explorer<\/strong> (top-right in Jupyter toolbar) \u2192 click any array \u2192 see shape, dtype, min\/max, plot preview<\/li>\n<\/ul>\n<h3 dir=\"auto\">4. Quick NumPy starter cell (copy-paste this every new notebook)<\/h3>\n<div dir=\"auto\">\n<div data-testid=\"code-block\">\n<div>\n<div>Python<\/div>\n<div>\n<pre tabindex=\"0\"><code># \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\r\n#          NumPy Starter Cell \u2013 2025 edition\r\n# \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\r\n\r\n%matplotlib inline\r\n%config InlineBackend.figure_format = 'retina'\r\n\r\nimport numpy as np\r\nimport pandas as pd\r\nimport matplotlib.pyplot as plt\r\nimport seaborn as sns\r\n\r\nsns.set_theme(style=\"whitegrid\", palette=\"muted\", font_scale=1.1)\r\npd.set_option('display.max_columns', 12)\r\npd.set_option('display.float_format', '{:.4f}'.format)\r\n\r\nprint(\"NumPy version:\", np.__version__)\r\nprint(\"Ready to go! \ud83d\ude80\")<\/code><\/pre>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<h3 dir=\"auto\">5. Most useful keyboard shortcuts (JupyterLab &amp; VS Code Jupyter)<\/h3>\n<div>\n<div dir=\"auto\">\n<table dir=\"auto\">\n<thead>\n<tr>\n<th data-col-size=\"xs\">Shortcut<\/th>\n<th data-col-size=\"lg\">JupyterLab<\/th>\n<th data-col-size=\"lg\">VS Code Jupyter<\/th>\n<th data-col-size=\"lg\">What it does<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td data-col-size=\"xs\">Shift + Enter<\/td>\n<td data-col-size=\"lg\">Run cell, go to next<\/td>\n<td data-col-size=\"lg\">Run cell, go to next<\/td>\n<td data-col-size=\"lg\">most used<\/td>\n<\/tr>\n<tr>\n<td data-col-size=\"xs\">Ctrl + Enter<\/td>\n<td data-col-size=\"lg\">Run cell, stay<\/td>\n<td data-col-size=\"lg\">Run cell, stay<\/td>\n<td data-col-size=\"lg\">re-run same cell<\/td>\n<\/tr>\n<tr>\n<td data-col-size=\"xs\">Alt + Enter<\/td>\n<td data-col-size=\"lg\">Run + insert new cell<\/td>\n<td data-col-size=\"lg\">Run + insert new cell<\/td>\n<td data-col-size=\"lg\">quick prototyping<\/td>\n<\/tr>\n<tr>\n<td data-col-size=\"xs\">Ctrl + \/<\/td>\n<td data-col-size=\"lg\">Toggle comment<\/td>\n<td data-col-size=\"lg\">Toggle comment<\/td>\n<td data-col-size=\"lg\">comment blocks fast<\/td>\n<\/tr>\n<tr>\n<td data-col-size=\"xs\">Ctrl + D<\/td>\n<td data-col-size=\"lg\">Delete cell<\/td>\n<td data-col-size=\"lg\">Delete cell<\/td>\n<td data-col-size=\"lg\">remove mistakes<\/td>\n<\/tr>\n<tr>\n<td data-col-size=\"xs\">Ctrl + Z<\/td>\n<td data-col-size=\"lg\">Undo cell action<\/td>\n<td data-col-size=\"lg\">Undo<\/td>\n<td data-col-size=\"lg\">lifesaver<\/td>\n<\/tr>\n<tr>\n<td data-col-size=\"xs\">Ctrl + M H<\/td>\n<td data-col-size=\"lg\">Show all shortcuts<\/td>\n<td data-col-size=\"lg\">Ctrl + K Ctrl + H<\/td>\n<td data-col-size=\"lg\">learn more shortcuts<\/td>\n<\/tr>\n<tr>\n<td data-col-size=\"xs\">A \/ B<\/td>\n<td data-col-size=\"lg\">Insert cell Above \/ Below<\/td>\n<td data-col-size=\"lg\">A \/ B (command mode)<\/td>\n<td data-col-size=\"lg\">fast cell creation<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<div><\/div>\n<\/div>\n<\/div>\n<h3 dir=\"auto\">6. Daily habits that make NumPy 10\u00d7 more pleasant<\/h3>\n<div>\n<div dir=\"auto\">\n<table dir=\"auto\">\n<thead>\n<tr>\n<th data-col-size=\"lg\">Habit<\/th>\n<th data-col-size=\"md\">Why it helps<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td data-col-size=\"lg\">Always use %matplotlib inline or widget<\/td>\n<td data-col-size=\"md\">Plots appear inside notebook<\/td>\n<\/tr>\n<tr>\n<td data-col-size=\"lg\">Start every notebook with the starter cell<\/td>\n<td data-col-size=\"md\">Consistent look &amp; feel<\/td>\n<\/tr>\n<tr>\n<td data-col-size=\"lg\">Use np.set_printoptions(precision=4, suppress=True)<\/td>\n<td data-col-size=\"md\">Cleaner array printing<\/td>\n<\/tr>\n<tr>\n<td data-col-size=\"lg\">Keep a \u201cscratch\u201d notebook open<\/td>\n<td data-col-size=\"md\">Quick tests without polluting main file<\/td>\n<\/tr>\n<tr>\n<td data-col-size=\"lg\">Use sns.set_theme() early<\/td>\n<td data-col-size=\"md\">Plots look professional with zero effort<\/td>\n<\/tr>\n<tr>\n<td data-col-size=\"lg\">Name arrays meaningfully (X_train, features, pixels, returns)<\/td>\n<td data-col-size=\"md\">Code becomes self-documenting<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<div><\/div>\n<\/div>\n<\/div>\n<h3 dir=\"auto\">7. Quick mini-exercise to feel the difference<\/h3>\n<p dir=\"auto\">Copy-paste and run these cells one by one:<\/p>\n<div dir=\"auto\">\n<div data-testid=\"code-block\">\n<div>\n<div>Python<\/div>\n<div>\n<pre tabindex=\"0\"><code># Cell 1 \u2013 classic Python\r\nlst = list(range(1_000_000))\r\n%timeit sum(lst)<\/code><\/pre>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<div dir=\"auto\">\n<div data-testid=\"code-block\">\n<div>\n<div>Python<\/div>\n<div>\n<pre tabindex=\"0\"><code># Cell 2 \u2013 NumPy\r\narr = np.arange(1_000_000)\r\n%timeit arr.sum()\r\n%timeit np.sum(arr)<\/code><\/pre>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<div dir=\"auto\">\n<div data-testid=\"code-block\">\n<div>\n<div>Python<\/div>\n<div>\n<pre tabindex=\"0\"><code># Cell 3 \u2013 why axis matters\r\nm = np.random.randint(1, 100, size=(6, 8))\r\nprint(\"Sum everything:\", m.sum())\r\nprint(\"Sum per column:\", m.sum(axis=0))\r\nprint(\"Sum per row:\", m.sum(axis=1))<\/code><\/pre>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<h3 dir=\"auto\">Final teacher message<\/h3>\n<p dir=\"auto\"><strong>You don\u2019t need a \u201cperfect\u201d setup on day 1.<\/strong><\/p>\n<p dir=\"auto\">Start with <strong>Google Colab<\/strong> or <strong>local JupyterLab<\/strong> \u2014 that\u2019s enough. After 1\u20134 weeks, when you feel you\u2019re writing real code and getting annoyed by small things \u2192 switch to <strong>VS Code + Jupyter extension<\/strong>.<\/p>\n<p dir=\"auto\">The most important thing is not the tool \u2014 it\u2019s <strong>writing many small cells<\/strong>, <strong>running them one by one<\/strong>, <strong>looking at shapes and values<\/strong>, <strong>printing intermediate results<\/strong>, and <strong>experimenting<\/strong>.<\/p>\n<p dir=\"auto\">You will become fluent much faster if you <strong>play a lot<\/strong> rather than trying to read everything perfectly first.<\/p>\n<p dir=\"auto\">Now \u2014 what would you like to do next?<\/p>\n<ul dir=\"auto\">\n<li>More exercises on array creation, indexing, broadcasting<\/li>\n<li>Common beginner mistakes &amp; how to debug them<\/li>\n<li>Setting up VS Code + Jupyter perfectly (with extensions &amp; shortcuts)<\/li>\n<li>Creating beautiful plots from day 1 with Seaborn + NumPy<\/li>\n<li>A small real mini-project to practice everything<\/li>\n<\/ul>\n<p dir=\"auto\">Just tell me what feels most helpful right now! \ud83d\ude0a<\/p>\n","protected":false},"excerpt":{"rendered":"<p>NumPy Editor \/ IDE \/ Working Environment Guide written in the style of a patient, experienced teacher who is sitting next to you and helping you set up the most comfortable, productive, and beginner-friendly&#46;&#46;&#46;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[75],"tags":[],"class_list":["post-2562","post","type-post","status-publish","format-standard","hentry","category-numpy"],"_links":{"self":[{"href":"https:\/\/demo.materiamedica.net\/demo6\/wp-json\/wp\/v2\/posts\/2562","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/demo.materiamedica.net\/demo6\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/demo.materiamedica.net\/demo6\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/demo.materiamedica.net\/demo6\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/demo.materiamedica.net\/demo6\/wp-json\/wp\/v2\/comments?post=2562"}],"version-history":[{"count":1,"href":"https:\/\/demo.materiamedica.net\/demo6\/wp-json\/wp\/v2\/posts\/2562\/revisions"}],"predecessor-version":[{"id":2563,"href":"https:\/\/demo.materiamedica.net\/demo6\/wp-json\/wp\/v2\/posts\/2562\/revisions\/2563"}],"wp:attachment":[{"href":"https:\/\/demo.materiamedica.net\/demo6\/wp-json\/wp\/v2\/media?parent=2562"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/demo.materiamedica.net\/demo6\/wp-json\/wp\/v2\/categories?post=2562"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/demo.materiamedica.net\/demo6\/wp-json\/wp\/v2\/tags?post=2562"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}