Skip to content

Commit c83596d

Browse files
committed
Created using Colaboratory
1 parent 727491a commit c83596d

File tree

1 file changed

+75
-2
lines changed

1 file changed

+75
-2
lines changed

data_and_ai.ipynb

+75-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"private_outputs": true,
88
"provenance": [],
99
"collapsed_sections": [],
10-
"authorship_tag": "ABX9TyMcumaRrJGtJnLYRbmh8Iop",
10+
"authorship_tag": "ABX9TyMHmEDVrEHGd9SFIIIRD4/z",
1111
"include_colab_link": true
1212
},
1313
"kernelspec": {
@@ -149,7 +149,7 @@
149149
{
150150
"cell_type": "markdown",
151151
"source": [
152-
"# Vertical line with matplotlib"
152+
"# Vertical line with matplotlib, how to add a vertical line with matplotlib"
153153
],
154154
"metadata": {
155155
"id": "LH85ipx0H255"
@@ -158,6 +158,12 @@
158158
{
159159
"cell_type": "code",
160160
"source": [
161+
"\"\"\"\n",
162+
" x can be a list like:\n",
163+
" plt.vlines(x = [4,14], ymin = 8, ymax = 32,\n",
164+
" colors = 'purple',\n",
165+
" linestyle='--')\n",
166+
"\"\"\"\n",
161167
"plt.vlines(x = 14, ymin = 8, ymax = 32,\n",
162168
" colors = 'purple',\n",
163169
" linestyle='--')"
@@ -167,6 +173,73 @@
167173
},
168174
"execution_count": null,
169175
"outputs": []
176+
},
177+
{
178+
"cell_type": "markdown",
179+
"source": [
180+
"# Plotting an array, How to plot an array"
181+
],
182+
"metadata": {
183+
"id": "foc9sa2MM7mh"
184+
}
185+
},
186+
{
187+
"cell_type": "code",
188+
"source": [
189+
"x = np.zeros(20)\n",
190+
"x[:5] = 10\n",
191+
"x[5:15] = np.arange(12,32,2)\n",
192+
"x[15:] = 30\n",
193+
"plt.plot(x)"
194+
],
195+
"metadata": {
196+
"id": "by-eKmBNM-W0"
197+
},
198+
"execution_count": null,
199+
"outputs": []
200+
},
201+
{
202+
"cell_type": "markdown",
203+
"source": [
204+
"# Months list"
205+
],
206+
"metadata": {
207+
"id": "U2EfN1b6WCVd"
208+
}
209+
},
210+
{
211+
"cell_type": "code",
212+
"source": [
213+
"months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']\n"
214+
],
215+
"metadata": {
216+
"id": "YH7Yi2BWWEg4"
217+
},
218+
"execution_count": null,
219+
"outputs": []
220+
},
221+
{
222+
"cell_type": "markdown",
223+
"source": [
224+
"# Getting the execution time"
225+
],
226+
"metadata": {
227+
"id": "dOXnCxfwWLo1"
228+
}
229+
},
230+
{
231+
"cell_type": "code",
232+
"source": [
233+
"import time\n",
234+
"start_time = time.time()\n",
235+
"main()\n",
236+
"print(\"--- %s seconds ---\" % (time.time() - start_time))"
237+
],
238+
"metadata": {
239+
"id": "9j6AQZAzWX53"
240+
},
241+
"execution_count": null,
242+
"outputs": []
170243
}
171244
]
172245
}

0 commit comments

Comments
 (0)