Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions matpltlib/10_subplots.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"<h1 align=\"center\", style=\"color:green\">Matplotlib Tutorial: Subplots</h1>"
"<h1 align=\"center\" style=\"color:green\">Matplotlib Tutorial: Subplots</h1>"
]
},
{
Expand Down Expand Up @@ -53,12 +53,14 @@
"expense=[2800,3000,2800,3400]\n",
"\n",
"plt.subplot(2,1,1)\n",
"# income.set_title('Income')\n",
"plt.bar(year,income)\n",
"plt.title('Income')\n",
"\n",
"plt.subplot(2,1,2)\n",
"plt.bar(year,expense,color='green')\n",
"plt.title('Expense')\n",
"\n",
"# plt.subplot(2,1,2)\n",
"# plt.bar(year,expense,color='green')"
"plt.tight_layout()\n"
]
}
],
Expand Down
6 changes: 3 additions & 3 deletions matpltlib/4_bar_chart/4_bar_chart.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"<h1 align=\"center\", style=\"color:green\">Matplotlib Tutorial: Bar Chart</h1>"
"<h1 align=\"center\" style=\"color:green\">Matplotlib Tutorial: Bar Chart</h1>"
]
},
{
Expand Down Expand Up @@ -155,7 +155,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"<h3>Horizontal bar chart using barh function<h3>"
"<h3>Horizontal bar chart using barh function</h3>"
]
},
{
Expand Down Expand Up @@ -189,7 +189,7 @@
"\n",
"plt.yticks(xpos,company)\n",
"plt.ylabel(\"Revenue(Bln)\")\n",
"plt.title('US Technolog Stocks')\n",
"plt.title('US Technology Stocks')\n",
"plt.legend()"
]
}
Expand Down
4 changes: 2 additions & 2 deletions matpltlib/5_histogram/5_histogram.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"<h1 align=\"center\", style=\"color:green\">Matplotlib Tutorial: Histogram</h1>"
"<h1 align=\"center\" style=\"color:green\">Matplotlib Tutorial: Histogram</h1>"
]
},
{
Expand Down Expand Up @@ -122,7 +122,7 @@
"<ul style=\"color:brown;font-weight: bold;\">\n",
" <li>80-100: Normal</li>\n",
" <li>100-125: Pre-diabetic</li>\n",
" <li>80-100: Diabetic</li>\n",
" <li>125-150: Diabetic</li>\n",
"</ul>"
]
},
Expand Down
2 changes: 1 addition & 1 deletion matpltlib/6_pie_chart/6_pie_chart.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"collapsed": true
},
"source": [
"<h1 align=\"center\", style=\"color:green\">Matplotlib Tutorial: Pie Charts</h1>"
"<h1 align=\"center\" style=\"color:green\">Matplotlib Tutorial: Pie Charts</h1>"
]
},
{
Expand Down
26 changes: 7 additions & 19 deletions numpy/nditer.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"<h1 style=\"color:green\" align='center'>Numpy tutorial: iterate numpy array using nditer</h1>"
"<h1 style=\"color:green\" align=\"center\">Numpy tutorial: iterate numpy array using nditer</h1>"
]
},
{
Expand Down Expand Up @@ -38,10 +38,7 @@
"output_type": "execute_result"
}
],
"source": [
"a = np.arange(12).reshape(3,4)\n",
"a"
]
"source": "a = np.arange(12).reshape(3, 4)\na"
},
{
"cell_type": "markdown",
Expand Down Expand Up @@ -167,7 +164,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"<h2 style=\"color:purple\">Fortan style ordering</h2>"
"<h2 style=\"color:purple\">Fortran style ordering</h2>"
]
},
{
Expand Down Expand Up @@ -226,10 +223,7 @@
]
}
],
"source": [
"for x in np.nditer(a, flags=['external_loop'],order='F'):\n",
" print(x)"
]
"source": "for x in np.nditer(a, flags=['external_loop'], order='F'):\n print(x)"
},
{
"cell_type": "markdown",
Expand Down Expand Up @@ -299,10 +293,7 @@
"output_type": "execute_result"
}
],
"source": [
"b = np.arange(3, 15, 4).reshape(3,1)\n",
"b"
]
"source": "b = np.arange(3, 15, 4).reshape(3, 1)\nb"
},
{
"cell_type": "code",
Expand All @@ -328,10 +319,7 @@
]
}
],
"source": [
"for x, y in np.nditer([a,b]):\n",
" print (x,y)"
]
"source": "for x, y in np.nditer([a, b]):\n print(x, y)"
}
],
"metadata": {
Expand All @@ -355,4 +343,4 @@
},
"nbformat": 4,
"nbformat_minor": 2
}
}
3 changes: 0 additions & 3 deletions numpy/numpy_tutorail_2.py

This file was deleted.

15 changes: 6 additions & 9 deletions numpy/numpy_tutorial.py
Original file line number Diff line number Diff line change
@@ -1,19 +1,16 @@
import numpy as np
import time
import sys
SIZE = 1000000
l1 = range(SIZE)
l2 = range(SIZE)
a1=np.arange(SIZE)
a2=np.arange(SIZE)
a1 = np.arange(SIZE)
a2 = np.arange(SIZE)

# python list
start = time.time()
result = [(x+y) for x,y in zip(l1,l2)]
print("python list took: ",(time.time()-start)*1000)
result = [(x + y) for x, y in zip(l1, l2)]
print("python list took: ", (time.time() - start) * 1000)
# numpy array
start= time.time()
start = time.time()
result = a1 + a2
print("numpy took: ", (time.time()-start)*1000)


print("numpy took: ", (time.time() - start) * 1000)
3 changes: 3 additions & 0 deletions numpy/numpy_tutorial_2.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import numpy as np

a = np.array([[1, 2, 3], [4, 5, 6]])