{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Introduction to Jupyter Notebooks\n", "\n", "In this tutorial, we discuss some basic tasks to get your Jupyter notebooks up and running on your computer." ] }, { "cell_type": "markdown", "metadata": { "collapsed": true, "jupyter": { "outputs_hidden": true } }, "source": [ "## Spellchecker: LanguageTool Browser Extension" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Last thing you want on your Jupyter notebooks is typos. Jupyter notebooks have some spellchecker extensions, but it gets problematic installing them on different software environments. For spellchecking, we actually recommend a free browser-based extension called **LanguageTool** [here](https://languagetool.org/). This extension not only checks for typos in your notebooks, but also anything you type within your browser as an extra bonus. Sweet!" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## How to check for Python and module versions" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Within your shell, you can issue the command:\n", "```HTML\n", "> python --version\n", "```\n", "Sometimes python's executable command name will be \"python3\", so you might need:\n", "```HTML\n", "> python3 --version\n", "```\n", "Within the Jupyter notebooks environment, to issue a system command, you will need to an exclamation mark (\"!\") in front as shown below, which will have the same effect:" ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Python 3.11.9\n" ] } ], "source": [ "!python3 --version" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "To check for version number of a Python module, you can view its `__version__` attribute as below." ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [], "source": [ "import numpy as np" ] }, { "cell_type": "code", "execution_count": 5, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "'2.0.0'" ] }, "execution_count": 5, "metadata": {}, "output_type": "execute_result" } ], "source": [ "np.__version__" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## How to read CSV files" ] }, { "cell_type": "code", "execution_count": 6, "metadata": {}, "outputs": [], "source": [ "import pandas as pd" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Assuming that your file is under a directory called `data`:" ] }, { "cell_type": "code", "execution_count": 7, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", " | mean_radius | \n", "mean_texture | \n", "mean_perimeter | \n", "mean_area | \n", "mean_smoothness | \n", "mean_compactness | \n", "mean_concavity | \n", "mean_concave_points | \n", "mean_symmetry | \n", "mean_fractal_dimension | \n", "... | \n", "worst_texture | \n", "worst_perimeter | \n", "worst_area | \n", "worst_smoothness | \n", "worst_compactness | \n", "worst_concavity | \n", "worst_concave_points | \n", "worst_symmetry | \n", "worst_fractal_dimension | \n", "diagnosis | \n", "
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0 | \n", "17.99 | \n", "10.38 | \n", "122.80 | \n", "1001.0 | \n", "0.11840 | \n", "0.27760 | \n", "0.3001 | \n", "0.14710 | \n", "0.2419 | \n", "0.07871 | \n", "... | \n", "17.33 | \n", "184.60 | \n", "2019.0 | \n", "0.1622 | \n", "0.6656 | \n", "0.7119 | \n", "0.2654 | \n", "0.4601 | \n", "0.11890 | \n", "M | \n", "
1 | \n", "20.57 | \n", "17.77 | \n", "132.90 | \n", "1326.0 | \n", "0.08474 | \n", "0.07864 | \n", "0.0869 | \n", "0.07017 | \n", "0.1812 | \n", "0.05667 | \n", "... | \n", "23.41 | \n", "158.80 | \n", "1956.0 | \n", "0.1238 | \n", "0.1866 | \n", "0.2416 | \n", "0.1860 | \n", "0.2750 | \n", "0.08902 | \n", "M | \n", "
2 | \n", "19.69 | \n", "21.25 | \n", "130.00 | \n", "1203.0 | \n", "0.10960 | \n", "0.15990 | \n", "0.1974 | \n", "0.12790 | \n", "0.2069 | \n", "0.05999 | \n", "... | \n", "25.53 | \n", "152.50 | \n", "1709.0 | \n", "0.1444 | \n", "0.4245 | \n", "0.4504 | \n", "0.2430 | \n", "0.3613 | \n", "0.08758 | \n", "M | \n", "
3 | \n", "11.42 | \n", "20.38 | \n", "77.58 | \n", "386.1 | \n", "0.14250 | \n", "0.28390 | \n", "0.2414 | \n", "0.10520 | \n", "0.2597 | \n", "0.09744 | \n", "... | \n", "26.50 | \n", "98.87 | \n", "567.7 | \n", "0.2098 | \n", "0.8663 | \n", "0.6869 | \n", "0.2575 | \n", "0.6638 | \n", "0.17300 | \n", "M | \n", "
4 | \n", "20.29 | \n", "14.34 | \n", "135.10 | \n", "1297.0 | \n", "0.10030 | \n", "0.13280 | \n", "0.1980 | \n", "0.10430 | \n", "0.1809 | \n", "0.05883 | \n", "... | \n", "16.67 | \n", "152.20 | \n", "1575.0 | \n", "0.1374 | \n", "0.2050 | \n", "0.4000 | \n", "0.1625 | \n", "0.2364 | \n", "0.07678 | \n", "M | \n", "
5 rows × 31 columns
\n", "