|
47 | 47 | "source": [ |
48 | 48 | "Installing Python packages is very simple and one of the most popular package managers to achieve this is `pip`. Here, `pip` accesses the [Python Package Index](https://pypi.org/) (`PyPI`) that contains a large number of Python packages.\n", |
49 | 49 | "\n", |
50 | | - "For our example we need the `NumPy` package and this can be installed via the following command in our terminal:\n", |
| 50 | + "For our example we need the `NumPy` package and this can be installed via the following command at the terminal/anaconda prompt (see [here](https://pythoninchemistry.org/import-anything) for more information about different operating systems):\n", |
51 | 51 | "\n", |
52 | 52 | "```bash\n", |
53 | 53 | "pip install numpy\n", |
|
99 | 99 | "cosine_angle = cos(angle)\n", |
100 | 100 | "```\n", |
101 | 101 | "\n", |
102 | | - "However, this can sometimes have unintended consequences if these functions share the same name with variables in a longer script. This problem can also arise using `from numpy import *`, which imports all functions without the need to use the `numpy.` syntax. To get around this it is common (and recommended) to `import` packages and rename them:\n", |
| 102 | + "However, this can sometimes have unintended consequences if these functions share the same name with variables in a longer script. This problem can also arise using `from numpy import *`, which imports all functions without the need to use the `numpy.` syntax. To get around this it is common to `import` packages and rename them:\n", |
103 | 103 | "\n", |
104 | 104 | "```python\n", |
105 | 105 | "## Import the specific functions from numpy\n", |
|
110 | 110 | "cosine_angle = np.cos(angle)\n", |
111 | 111 | "```\n", |
112 | 112 | "\n", |
113 | | - "Although our example has used the `numpy` package, there are a large number of packages to choose from and each have a customary name that is often used. These include `matplotlib`, `pandas`, and `scipy`:\n", |
| 113 | + "Although our example has used the `numpy` package, there are a large number of packages to choose from and each have a customary name that is often used. For example:\n", |
114 | 114 | "\n", |
115 | 115 | "```python\n", |
116 | 116 | "import matplotlib as mpl \n", |
117 | 117 | "import matplotlib.pyplot as plt \n", |
118 | 118 | "import numpy as np\n", |
119 | 119 | "import pandas as pd\n", |
120 | | - "import scipy as sp\n", |
121 | 120 | "``` " |
122 | 121 | ] |
123 | | - }, |
124 | | - { |
125 | | - "cell_type": "code", |
126 | | - "execution_count": null, |
127 | | - "metadata": {}, |
128 | | - "outputs": [], |
129 | | - "source": [] |
130 | 122 | } |
131 | 123 | ], |
132 | 124 | "metadata": { |
|
0 commit comments