{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Software installation test\n", "\n", "This Jupyter notebook is for The Open University's _Learn to code for data analysis_ course.\n", "It checks whether your software installation is working as expected.\n", "\n", "To do that, you must open this notebook from within the Jupyter app in Anaconda \n", "or by using a cloud service like CoCalc or Microsoft Azure. \n", "\n", "Then, in the menu above, click on 'Cell' and then on 'Run all'.\n", "This will execute the code below. (The code will be explained in the course.)\n", "\n", "After a while you should see some text stating which version of pandas\n", "(the data analysis software we will be using) you have installed, \n", "and after another moment you should see a graph with two dots plotted on it.\n", "If you are using a cloud service to run Jupyter notebooks,\n", "it will take longer for the text and graph to appear.\n", "In Azure you may get a warning that the font cache for graph labels is being built.\n", "\n", "## Anaconda\n", "\n", "If you're using Anaconda, if the pandas version displayed is 0.20 or higher and you don't get any error messages, \n", "then all's well and you can close this notebook (menu 'File', option 'Close and Halt') \n", "and then delete the notebook from your disk if you wish.\n", "\n", "If there is an error message saying you don't have Python 3, \n", "or if the pandas version displayed is below 0.20, \n", "then one of the following has probably happened: \n", "\n", "- you installed the wrong version of Anaconda;\n", "- you installed the wrong variant of Anaconda (there are two variants, for Python 2 and Python 3, of the same version of Anaconda); \n", "- during the installation you decided to keep your existing Python installation. \n", "\n", "To see which software versions you have installed, \n", "click on the 'Help' menu above, and then on the 'About' option. \n", "You should have the notebook server version 5.0 or higher, \n", "Python version 3.5 or higher, and IPython version 6.1 or higher. \n", "\n", "## CoCalc and Microsoft Azure\n", "\n", "If you're using one of these cloud services and if there are no error messages, \n", "then all's well and you can close this notebook and delete it from \n", "your project (CoCalc) or library (Azure) if you wish. \n", "To close a notebook in CoCalc, click x on the tab at the top. \n", "To close a notebook in Azure, select menu 'File', option 'Close and Halt'.\n", "\n", "If you get an error that you don't have Python 3, then click on the 'Kernel' menu above, \n", "select the 'Change kernel' option, and finally select one of the 'Python 3' options in the menu. \n", "You will see some messages on the top right side whilst the kernel\n", "(the software that runs the notebook) is being changed. \n", "Once the messages disappear, you can click again on 'Run all' in the 'Cell' menu." ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "import warnings\n", "warnings.simplefilter('ignore', FutureWarning)\n", "\n", "import pandas\n", "from pandas import DataFrame\n", "\n", "print('Your pandas version is', pandas.__version__)\n", "\n", "if 1 / 2 == 0:\n", " print('Error: you are not running Python 3')\n", " \n", "df = DataFrame(data=[[1,2], [2,1]], columns=['x','y'])\n", "\n", "%matplotlib inline\n", "df.plot('x', 'y', kind='scatter')\n", "\n", "from scipy.stats import spearmanr" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "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" } }, "nbformat": 4, "nbformat_minor": 1 }