{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# [MCB 32L]: Introduction to Python\n", "---\n", "\n", "### Professor Robin Ball\n", "\n", "We will introduce you to data analysis using Python and Jupyter notebooks, which you will use in other labs this semester.\n", "\n", "*Estimated Time: ~1 Hour*\n", "\n", "---\n", "\n", "### Table of Contents\n", "\n", "Intro to Jupyter notebooks
\n", "\n", "1. Introduction to Python
\n", "\n", " a Entering and Naming your data
\n", "\n", " b Basic calculations
\n", " \n", "2. Graphing with `matplotlib`
\n", "\n", "3. Graphing reaction time data
\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Welcome to Jupyter \n", "\n", "Welcome to the Jupyter Notebook! **Notebooks** are documents that can contain text, code, visualizations, and more. We'll be using them in this lab to manipulate and visualize our data.\n", "\n", "A notebook is composed of rectangular sections called **cells**. There are two kinds of cells: markdown and code. A **markdown cell**, such as this one, contains text. A **code cell** contains code in Python, a programming language that we will be using for the remainder of this module. You can select any cell by clicking it once. After a cell is selected, you can navigate the notebook using the up and down arrow keys.\n", "\n", "To run a code cell once it's been selected, \n", "- press Shift-Enter, or\n", "- click the Run button in the toolbar at the top of the screen. \n", "\n", "If a code cell is running, you will see an asterisk (\\*) appear in the square brackets to the left of the cell. Once the cell has finished running, a number will replace the asterisk and any output from the code will appear under the cell." ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "# run this cell\n", "print(\"Hello World!\")" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "You'll notice that many code cells contain lines of blue text that start with a `#`. These are *comments*. Comments often contain helpful information about what the code does or what you are supposed to do in the cell. The leading `#` tells the computer to ignore them." ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "# this is a comment- running the cell will do nothing!" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Code cells can be edited any time after they are highlighted. Try editing the next code cell to print your name." ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "# edit the code to print your name\n", "print(\"Hello: my name is (name)\")" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "#### Saving and Loading\n", "\n", "Your notebook can record all of your text and code edits, as well as any graphs you generate or calculations you make. You can save the notebook in its current state by clicking Control-S, clicking the floppy disc icon in the toolbar at the top of the page, or by going to the File menu and selecting \"Save and Checkpoint\".\n", "\n", "The next time you open the notebook, it will look the same as when you last saved it.\n", "\n", "**Note:** after loading a notebook you will see all the outputs (graphs, computations, etc) from your last session, but you won't be able to use any variables you assigned or functions you defined. You can get the functions and variables back by re-running the cells where they were defined- the easiest way is to highlight the cell where you left off work, then go to the Cell menu at the top of the screen and click \"Run all above\". You can also use this menu to run all cells in the notebook by clicking \"Run all\"." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "#### Completing the Notebooks\n", "\n", "\n", "
\n", "\n", "**QUESTION** cells are in blue and ask you to enter in lab data, make graphs, or do other lab tasks. To receive full credit for your lab, you must complete all **QUESTION** cells and run all the code.\n", "\n", "\n", "
\n", "\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# 1. Python \n", "\n", "**Python** is programming language- a way for us to communicate with the computer and give it instructions. Just like any language, Python has a *vocabulary* made up of words it can understand, and a *syntax* giving the rules for how to structure communication.\n", "\n", "Python doesn't have a large vocabulary or syntax, but it can be used for many, many computational tasks.\n", "\n", "Bits of communication in Python are called **expressions**- they tell the computer what to do with the data we give it.\n", "\n", "Here's an example of an expression. " ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "# an expression\n", "14 + 20" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "When you run the cell, the computer evaluates the expression and prints the result. Note that only the last line in a code cell will be printed, unless you explicitly tell the computer you want to print the result." ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "# more expressions. what gets printed and what doesn't?\n", "100 / 10\n", "\n", "print(4.3 + 10.98)\n", "\n", "33 - 9 * (40000 + 1)\n", "\n", "884" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Many basic arithmetic operations are built in to Python, like `*` (multiplication), `+` (addition), `-` (subtraction), and `/` (division). There are many others, which you can find information about [here](http://www.inferentialthinking.com/chapters/03/1/expressions.html). \n", "\n", "The computer evaluates arithmetic according to the PEMDAS order of operations (just like you probably learned in middle school): anything in parentheses is done first, followed by exponents, then multiplication and division, and finally addition and subtraction." ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "# before you run this cell, can you say what it should print?\n", "4 - 2 * (1 + 6 / 3)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "#### A Note on Errors \n", "\n", "Python is a language, and like natural human languages, it has rules. It differs from natural language in two important ways:\n", "1. The rules are *simple*. You can learn most of them in a few weeks and gain reasonable proficiency with the language in a semester.\n", "2. The rules are *rigid*. If you're proficient in a natural language, you can understand a non-proficient speaker, glossing over small mistakes. A computer running Python code is not smart enough to do that.\n", "\n", "Whenever you write code, you'll make mistakes. When you run a code cell that has errors, Python will sometimes produce error messages to tell you what you did wrong.\n", "\n", "Errors are normal; experienced programmers see errors all the time. When you make an error, you just have to find the source of the problem, fix it, and move on.\n", "\n", "We have made an error in the next cell. Delete the `#`, then run it and see what happens.\n" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "# print(\"This line is missing something.\"" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "You should see something like this (minus our annotations):\n", "\n", "![Error Image](img/error.jpg)\n", "\n", "The last line of the error output attempts to tell you what went wrong. The *syntax* of a language is its structure, and this `SyntaxError` tells you that you have created an illegal structure. \"`EOF`\" means \"end of file,\" so the message is saying Python expected you to write something more (in this case, a right parenthesis) before finishing the cell.\n", "\n", "There's a lot of terminology in programming languages, but you don't need to know it all in order to program effectively. If you see a cryptic message like this, you can often get by without deciphering it. (Of course, if you're frustrated, you can usually find out by searching for the error message online or asking course staff for help)." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### 1a. Entering and Naming your data \n", "Sometimes, the values you work with can get cumbersome- maybe the expression that gives the value is very complicated, or maybe the value itself is long. In these cases it's useful to give the value a **name**.\n", "\n", "We can name values using what's called an *assignment* statement." ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "# assigns 442 to x\n", "x = 442" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "The assignment statement has three parts. On the left is the *name* (`x`). On the right is the *value* (442). The *equals sign* in the middle tells the computer to assign the value to the name.\n", "\n", "You'll notice that when you run the cell with the assignment, it doesn't print anything. But, if we try to access `x` again in the future, it will have the value we assigned it." ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "# show the value of x\n", "x" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "You can also assign names to expressions. The computer will compute the expression and assign the name to the result of the computation." ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "y = 50 * 2 + 1\n", "y" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "We can then use these names as if they were whatever they stand for (in this case, numbers)." ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "x - 42" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "x + y" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "#### Lists\n", "In Python, you can also make lists of numbers. A Python **list** is enclosed in square brackets. Items inside the list are separated by commas." ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "# a list\n", "[7.0, 6.24, 9.98, 4]" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Lists can have names too, which is handy for when you want to want to save a set of items without writing them out over and over again." ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "my_list = [4, 8, 15, 16, 23, 42]\n", "my_list" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### 1b. Basic calculations \n", "Once you have your data in a list, Python has a variety of functions that can be used to perform calculations and draw conclusions." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "#### Built-in functions\n", "The most basic functions are built into Python. This means that Python already knows how to perform these functions without you needing to define them or import a library of functions. The `print()` function you saw earlier is an example of a built-in function. A full list of all built-in Python functions can be found [here](https://docs.python.org/3/library/functions.html).\n", "\n", "Below are a few examples of functions you may find useful during this class" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "# what do you think this function calculates?\n", "min(my_list)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "# what about this one?\n", "max(my_list)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "In this example, we passed a single list to each of the functions. However, you can also pass multiple numbers separated by commas, or even multiple lists! You can try it out below and see if you can figure out how Python is choosing which list is greater than the other." ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "max([1, 2, 3], [3, 2, 0])" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Some functions have _optional_ arguments. For instance, the most basic usage of the `round()` function takes a single argument." ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "round(3.14159)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "You can also specify a second argument, which specifies how many decimal places you would like the output to have. If you don't include this argument, Python uses the _default_, which is zero." ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "round(3.14159, 2)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "#### `numpy`\n", "For more complex calculations, you will need to either define functions or import functions that someone else has written. For numerical calculations, `numpy` is a popular library containing a wide variety of functions. If you are curious about all of the functions in the library, the `numpy` documentation can be found [here](https://docs.scipy.org/doc/numpy/reference/).\n", "\n", "In order to use these functions, you have to first run an import statement. Import statements for all required libraries are typically run at the beginning of a notebook." ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "# This gives numpy an abbbreviation so that when we refer to it later we don't need to write the whole name out.\n", "# We could abbreviate it however we want, but np is the conventional abbreviation for numpy.\n", "import numpy as np" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Now you can use all the functions in the `numpy` library. When using these functions, you must prefix them with `np.` so that Python knows to look in the `numpy` library for the function." ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "np.mean(my_list)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# 2. Graphing with `matplotlib` \n", "The `matplotlib` library includes a variety of functions that allow us to build plots of data. Once again, you must first import the library before you can use it." ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "# Import the library\n", "import matplotlib.pyplot as plt\n", "\n", "# This line allows the plots display to nicely in the notebook.\n", "%matplotlib inline" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Before you can use the plotting functions, you must first have some data to plot. Below are some data on Berkeley restaurants taken from Yelp." ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "restaurants = [\"Gypsy's\", \"Tacos Sinaloa\", \"Sliver\", \"Muracci's\", \"Brazil Cafe\", \"Thai Basil\"]\n", "rating = [4, 4, 4, 3.5, 4.5, 3.5]\n", "number_of_ratings = [1666, 347, 1308, 294, 1246, 904]" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "You may be interested in seeing if there is a relationship between the number of ratings a restaurant has and their rating out 5 stars. It is difficult to determine this from looking at the numbers directly, so a plot can come in handy." ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "# create a scatter plot\n", "plt.scatter(number_of_ratings, rating)\n", "\n", "# show the plot\n", "plt.show()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Out of context, this plot is not very helpful because it doesn't have axis labels or a title. These components can be added using other `matplotlib` functions." ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "# create a scatter plot\n", "plt.scatter(number_of_ratings, rating)\n", "\n", "# add the x-axis label\n", "plt.xlabel(\"Number of Ratings\")\n", "\n", "# add the y-axis label\n", "plt.ylabel(\"Star Rating (out of 5)\")\n", "\n", "# add a title\n", "plt.title(\"Berkeley Restaurant Star Ratings by Number of Ratings\")\n", "\n", "# show the plot\n", "plt.show()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "There are many other attributes you can add to plots and many more types of plots you can create using this library. For a comprehensive description, visit the [documentation](https://matplotlib.org/api/pyplot_api.html)! Included here are some basic plots that you may find useful for this class." ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "# create a bar plot\n", "plt.bar(restaurants, number_of_ratings)\n", "\n", "# add the x-axis label\n", "plt.xlabel(\"Restaurant\")\n", "\n", "# add the y-axis label\n", "plt.ylabel(\"Number of Ratings\")\n", "\n", "# add a title\n", "plt.title(\"Berkeley Restaurant Star Ratings\")\n", "\n", "# show the plot\n", "plt.show()" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "# create a histogram\n", "plt.hist(rating)\n", "\n", "# add the x-axis label\n", "plt.xlabel(\"Star Rating (out of 5)\")\n", "\n", "# add the y-axis label\n", "plt.ylabel(\"Frequency\")\n", "\n", "# add a title\n", "plt.title(\"Berkeley Restaurant Star Rating Frequencies\")\n", "\n", "# show the plot\n", "plt.show()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "It is also possible to overlay multiple lines on a single plot. Below are some made up data about the number of people with each height in two different classes." ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "height = [60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72]\n", "class_one = [1, 1, 0, 3, 7, 4, 3, 7, 8, 3, 1, 2, 1]\n", "class_two = [0, 0, 3, 1, 3, 4, 1, 2, 6, 2, 8, 5, 2]" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "You can use the `.plot()` function to plot both of these functions as line plots. If you run multiple calls to plotting functions in the same cell, Python will simply layer the resulting plots on the same plot." ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "# create a line plot for the first class\n", "# label this line as class one for the legend\n", "plt.plot(height, class_one, label = \"class one\")\n", "\n", "# create a line plot for the second class\n", "# label this line as class two for the legend\n", "plt.plot(height, class_two, label = \"class two\")\n", "\n", "# add the x-axis label\n", "plt.xlabel(\"Height (in)\")\n", "\n", "# add the y-axis label\n", "plt.ylabel(\"Frequency\")\n", "\n", "# add the legend\n", "plt.legend()\n", "\n", "# add the title\n", "plt.title(\"Frequencies of Different Heights for Two Classes\")\n", "\n", "# show the plot\n", "plt.show()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# 3. Graphing reaction time data \n", "Now you will have a chance to make a graph with the reaction time data you collected during your lab. We will go over two different ways of entering your data.\n", "\n", "### 3a. Using a list to enter data\n", "\n", "
\n", " \n", "**QUESTION:** Fill in the '...' with a list containing the reaction time values (in milliseconds) you recorded during lab.\n", "\n", "
" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "visual_reaction_time = [...]\n", "auditory_reaction_time = [...]" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Let's make a table from our two lists. Note that we enter the name of the column followed by the name of the list we want to put into that column." ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "#Run this cell to import the function to make a table\n", "\n", "from datascience import *" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "Reaction_time_table = Table().with_columns(\"Visual reaction time\", visual_reaction_time, \"Auditory reaction time\", auditory_reaction_time)\n", "Reaction_time_table" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Now you will take the mean of these data in order to create your bar plot. We will use the function `np.mean()`.\n", "\n", "
\n", " \n", "**QUESTION:** Pass your lists to `np.mean` below so that the means are saved to the variables `visual_reaction_time_mean` and `auditory_reaction_time_mean`. You do not need to type in the numbers again, because you already assigned a name to each list. Put that name into the np.mean().\n", "\n", "
" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "visual_reaction_time_mean = ...\n", "auditory_reaction_time_mean = ...\n", "\n", "print(visual_reaction_time_mean)\n", "print(auditory_reaction_time_mean)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Next, you will need to consider what type of graph is most suited to your data. Then, use the plotting functions you have just learned to create a plot of the data. Don't forget to add informative labels!\n", "\n", "
\n", " \n", "**QUESTION:** Create a bar plot of your data. Label your axes and remember to include units for the reaction times. You can copy the correct commands for labeling the axes from the graphs you made above. Just change the specific name for the axes.\n", "\n", "
\n", "\n", "_Hint:_ Create two lists, one with the names of the variables (what will be on the x-axis) and another with the means you want to graph, and then pass those lists to `plt.bar()`. Again, you don't need to write in the numerical means, because you gave each mean a name in the cell above. The number for the visual reaction time mean is stored in the variable \"visual_reaction_time_mean\"." ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "# create two lists and then a bar plot from those lists\n", "names = [...,...]\n", "means = [...,...]\n", "plt.bar(names, means)\n", "\n", "# add the x-axis label\n", "\n", "\n", "# add the y-axis label\n", "\n", "\n", "# add a title\n", "\n", "\n", "# show the plot\n", "plt.show()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### 3b. Using a table to enter data\n", "\n", "If you have a lot of data to enter, it might be easier to type it into an already existing grid, rather than writing all the numbers as a list. You will make a table of your reaction time data using this method.\n", "\n", "
\n", " \n", "**QUESTION:** Run the cell below to make the blank grid. Then replace the 0 values with your reaction time data. You can use the Tab key to move quickly between cells. Note that if you enter your data and then re-run the cell below, it will go back to zeroes and you will have to enter the numbers again.\n", "\n", "
" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "from table import *\n", "\n", "reaction_time_table = make_table(rows = 5, cols = 3, \n", " labels = [\"Trial number\", \"Visual reaction time (ms)\", \"Auditory reaction time (ms)\"], \n", " types = [\"integer\", \"decimal\", \"decimal\"],\n", " values = {\"Trial number\" : [\"1\", \"2\", \"3\", \"4\", \"5\"]})\n" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "reaction_time_table" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "You will get more practice working with tables and graphing data from tables in future labs, so we will end here.\n", "\n", "In future labs, you will primarily use the make_table method, but if you do not like that method remember that you can also enter the data as lists. " ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "You have just created your first plot! In the future, you can use this lab as a reference for Python basics and how to create simple graphs." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "\n", "---\n", "### Saving the Notebook as an html file\n", "\n", "Congrats on finishing your first lab notebook! To turn in this lab assignment follow the steps below:\n", "\n", "1. Go to the File menu\n", "2. Go to 'Save and Export Notebook As'\n", "3. Select HTML\n", "4. You will upload the html file into the bCourses assignment\n", "\n", "If you also want to create a pdf version of the file for your records, follow these instructions:\n", "\n", "1. Press `Control + P` (or `Command + P` on Mac) to open the Print preview\n", "2. Change the destination so that it saves locally on your own computer.\n", "3. Save as PDF\n", "4. If you are stuck, follow further instructions [here](https://www.wikihow.com/Save-a-Web-Page-as-a-PDF-in-Google-Chrome).\n", "\n", "\n", "---\n", "#### References\n", "\n", "- Sections of \"Intro to Jupyter\", adapted from materials by Kelly Chen and Ashley Chien in [UC Berkeley Data Science Modules core resources](http://github.com/ds-modules/core-resources)\n", "- \"A Note on Errors\" subsection and \"error\" image adapted from materials by Chris Hench and Mariah Rogers for the Medieval Studies 250: Text Analysis for Graduate Medievalists [data science module](https://github.com/ds-modules/MEDST-250).\n", "- \"Intro to Jupyter\" and \"Intro to Python\" adapted from materials by Keeley Takimoto for the Berkeley Executive Education [Program on Data Science and Analytics Module](https://github.com/ds-modules/BEE)\n", "---\n", "Notebook developed by: Monica Wilkinson and Alex Nakagawa\n", "\n", "Data Science Modules: http://data.berkeley.edu/education/modules" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ " " ] } ], "metadata": { "kernelspec": { "display_name": "Python 3 (ipykernel)", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.11.2" }, "toc": { "base_numbering": 1, "nav_menu": {}, "number_sections": true, "sideBar": true, "skip_h1_title": false, "title_cell": "Table of Contents", "title_sidebar": "Contents", "toc_cell": false, "toc_position": {}, "toc_section_display": true, "toc_window_display": false }, "varInspector": { "cols": { "lenName": 16, "lenType": 16, "lenVar": 40 }, "kernels_config": { "python": { "delete_cmd_postfix": "", "delete_cmd_prefix": "del ", "library": "var_list.py", "varRefreshCmd": "print(var_dic_list())" }, "r": { "delete_cmd_postfix": ") ", "delete_cmd_prefix": "rm(", "library": "var_list.r", "varRefreshCmd": "cat(var_dic_list()) " } }, "types_to_exclude": [ "module", "function", "builtin_function_or_method", "instance", "_Feature" ], "window_display": false } }, "nbformat": 4, "nbformat_minor": 2 }