Skip to content

Commit 470e19c

Browse files
committed
updates
1 parent ff97614 commit 470e19c

File tree

13 files changed

+187
-37
lines changed

13 files changed

+187
-37
lines changed

Diff for: ch01/ch01.ipynb

+1-1
Original file line numberDiff line numberDiff line change
@@ -564,7 +564,7 @@
564564
"name": "python",
565565
"nbconvert_exporter": "python",
566566
"pygments_lexer": "ipython3",
567-
"version": "3.7.3"
567+
"version": "3.7.1"
568568
}
569569
},
570570
"nbformat": 4,

Diff for: ch02/ch02.ipynb

+9-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,15 @@
5959
"cell_type": "markdown",
6060
"metadata": {},
6161
"source": [
62-
"*The use of `watermark` is optional. You can install this IPython extension via \"`pip install watermark`\". For more information, please see: https://github.com/rasbt/watermark.*"
62+
"*The use of `watermark` is optional. You can install this Jupyter extension via* \n",
63+
"\n",
64+
" conda install watermark -c conda-forge \n",
65+
"\n",
66+
"or \n",
67+
"\n",
68+
" pip install watermark \n",
69+
"\n",
70+
"*For more information, please see: https://github.com/rasbt/watermark.*"
6371
]
6472
},
6573
{

Diff for: ch03/ch03.ipynb

+9-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,15 @@
6060
"cell_type": "markdown",
6161
"metadata": {},
6262
"source": [
63-
"*The use of `watermark` is optional. You can install this IPython extension via \"`pip install watermark`\". For more information, please see: https://github.com/rasbt/watermark.*"
63+
"*The use of `watermark` is optional. You can install this Jupyter extension via* \n",
64+
"\n",
65+
" conda install watermark -c conda-forge \n",
66+
"\n",
67+
"or \n",
68+
"\n",
69+
" pip install watermark \n",
70+
"\n",
71+
"*For more information, please see: https://github.com/rasbt/watermark.*"
6472
]
6573
},
6674
{

Diff for: ch04/ch04.ipynb

+85-3
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
"output_type": "stream",
4343
"text": [
4444
"Sebastian Raschka \n",
45-
"last updated: 2019-06-16 \n",
45+
"last updated: 2019-07-09 \n",
4646
"\n",
4747
"numpy 1.16.2\n",
4848
"pandas 0.24.2\n",
@@ -60,7 +60,15 @@
6060
"cell_type": "markdown",
6161
"metadata": {},
6262
"source": [
63-
"*The use of `watermark` is optional. You can install this IPython extension via \"`pip install watermark`\". For more information, please see: https://github.com/rasbt/watermark.*"
63+
"*The use of `watermark` is optional. You can install this Jupyter extension via* \n",
64+
"\n",
65+
" conda install watermark -c conda-forge \n",
66+
"\n",
67+
"or \n",
68+
"\n",
69+
" pip install watermark \n",
70+
"\n",
71+
"*For more information, please see: https://github.com/rasbt/watermark.*"
6472
]
6573
},
6674
{
@@ -616,7 +624,7 @@
616624
}
617625
],
618626
"source": [
619-
"# drop rows that have less than 3 real values \n",
627+
"# drop rows that have fewer than 3 real values \n",
620628
"\n",
621629
"df.dropna(thresh=4)"
622630
]
@@ -767,6 +775,80 @@
767775
"<br>"
768776
]
769777
},
778+
{
779+
"cell_type": "code",
780+
"execution_count": 14,
781+
"metadata": {},
782+
"outputs": [
783+
{
784+
"data": {
785+
"text/html": [
786+
"<div>\n",
787+
"<style scoped>\n",
788+
" .dataframe tbody tr th:only-of-type {\n",
789+
" vertical-align: middle;\n",
790+
" }\n",
791+
"\n",
792+
" .dataframe tbody tr th {\n",
793+
" vertical-align: top;\n",
794+
" }\n",
795+
"\n",
796+
" .dataframe thead th {\n",
797+
" text-align: right;\n",
798+
" }\n",
799+
"</style>\n",
800+
"<table border=\"1\" class=\"dataframe\">\n",
801+
" <thead>\n",
802+
" <tr style=\"text-align: right;\">\n",
803+
" <th></th>\n",
804+
" <th>A</th>\n",
805+
" <th>B</th>\n",
806+
" <th>C</th>\n",
807+
" <th>D</th>\n",
808+
" </tr>\n",
809+
" </thead>\n",
810+
" <tbody>\n",
811+
" <tr>\n",
812+
" <th>0</th>\n",
813+
" <td>1.0</td>\n",
814+
" <td>2.0</td>\n",
815+
" <td>3.0</td>\n",
816+
" <td>4.0</td>\n",
817+
" </tr>\n",
818+
" <tr>\n",
819+
" <th>1</th>\n",
820+
" <td>5.0</td>\n",
821+
" <td>6.0</td>\n",
822+
" <td>7.5</td>\n",
823+
" <td>8.0</td>\n",
824+
" </tr>\n",
825+
" <tr>\n",
826+
" <th>2</th>\n",
827+
" <td>10.0</td>\n",
828+
" <td>11.0</td>\n",
829+
" <td>12.0</td>\n",
830+
" <td>6.0</td>\n",
831+
" </tr>\n",
832+
" </tbody>\n",
833+
"</table>\n",
834+
"</div>"
835+
],
836+
"text/plain": [
837+
" A B C D\n",
838+
"0 1.0 2.0 3.0 4.0\n",
839+
"1 5.0 6.0 7.5 8.0\n",
840+
"2 10.0 11.0 12.0 6.0"
841+
]
842+
},
843+
"execution_count": 14,
844+
"metadata": {},
845+
"output_type": "execute_result"
846+
}
847+
],
848+
"source": [
849+
"df.fillna(df.mean())"
850+
]
851+
},
770852
{
771853
"cell_type": "markdown",
772854
"metadata": {},

Diff for: ch05/ch05.ipynb

+9-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,15 @@
6060
"cell_type": "markdown",
6161
"metadata": {},
6262
"source": [
63-
"*The use of `watermark` is optional. You can install this IPython extension via \"`pip install watermark`\". For more information, please see: https://github.com/rasbt/watermark.*"
63+
"*The use of `watermark` is optional. You can install this Jupyter extension via* \n",
64+
"\n",
65+
" conda install watermark -c conda-forge \n",
66+
"\n",
67+
"or \n",
68+
"\n",
69+
" pip install watermark \n",
70+
"\n",
71+
"*For more information, please see: https://github.com/rasbt/watermark.*"
6472
]
6573
},
6674
{

Diff for: ch06/ch06.ipynb

+9-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,15 @@
6363
"cell_type": "markdown",
6464
"metadata": {},
6565
"source": [
66-
"*The use of `watermark` is optional. You can install this IPython extension via \"`pip install watermark`\". For more information, please see: https://github.com/rasbt/watermark.*"
66+
"*The use of `watermark` is optional. You can install this Jupyter extension via* \n",
67+
"\n",
68+
" conda install watermark -c conda-forge \n",
69+
"\n",
70+
"or \n",
71+
"\n",
72+
" pip install watermark \n",
73+
"\n",
74+
"*For more information, please see: https://github.com/rasbt/watermark.*"
6775
]
6876
},
6977
{

Diff for: ch07/ch07.ipynb

+10-2
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,15 @@
6464
"cell_type": "markdown",
6565
"metadata": {},
6666
"source": [
67-
"*The use of `watermark` is optional. You can install this IPython extension via \"`pip install watermark`\". For more information, please see: https://github.com/rasbt/watermark.*"
67+
"*The use of `watermark` is optional. You can install this Jupyter extension via* \n",
68+
"\n",
69+
" conda install watermark -c conda-forge \n",
70+
"\n",
71+
"or \n",
72+
"\n",
73+
" pip install watermark \n",
74+
"\n",
75+
"*For more information, please see: https://github.com/rasbt/watermark.*"
6876
]
6977
},
7078
{
@@ -1693,7 +1701,7 @@
16931701
"name": "python",
16941702
"nbconvert_exporter": "python",
16951703
"pygments_lexer": "ipython3",
1696-
"version": "3.7.3"
1704+
"version": "3.7.1"
16971705
},
16981706
"toc": {
16991707
"nav_menu": {},

Diff for: ch08/ch08.ipynb

+10-2
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,15 @@
6363
"cell_type": "markdown",
6464
"metadata": {},
6565
"source": [
66-
"*The use of `watermark` is optional. You can install this IPython extension via \"`pip install watermark`\". For more information, please see: https://github.com/rasbt/watermark.*"
66+
"*The use of `watermark` is optional. You can install this Jupyter extension via* \n",
67+
"\n",
68+
" conda install watermark -c conda-forge \n",
69+
"\n",
70+
"or \n",
71+
"\n",
72+
" pip install watermark \n",
73+
"\n",
74+
"*For more information, please see: https://github.com/rasbt/watermark.*"
6775
]
6876
},
6977
{
@@ -1887,7 +1895,7 @@
18871895
"name": "python",
18881896
"nbconvert_exporter": "python",
18891897
"pygments_lexer": "ipython3",
1890-
"version": "3.7.3"
1898+
"version": "3.7.1"
18911899
},
18921900
"toc": {
18931901
"nav_menu": {},

Diff for: ch09/ch09.ipynb

+9-1
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,15 @@
6666
"cell_type": "markdown",
6767
"metadata": {},
6868
"source": [
69-
"*The use of `watermark` is optional. You can install this IPython extension via \"`pip install watermark`\". For more information, please see: https://github.com/rasbt/watermark.*"
69+
"*The use of `watermark` is optional. You can install this Jupyter extension via* \n",
70+
"\n",
71+
" conda install watermark -c conda-forge \n",
72+
"\n",
73+
"or \n",
74+
"\n",
75+
" pip install watermark \n",
76+
"\n",
77+
"*For more information, please see: https://github.com/rasbt/watermark.*"
7078
]
7179
},
7280
{

Diff for: ch10/ch10.ipynb

+24-22
Large diffs are not rendered by default.

Diff for: ch10/ch10.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -505,10 +505,12 @@ def lin_regplot(X, y, model):
505505
plt.scatter(X, y, label='training points')
506506
plt.plot(X_fit, y_lin_fit, label='linear fit', linestyle='--')
507507
plt.plot(X_fit, y_quad_fit, label='quadratic fit')
508+
plt.xlabel('Explanatory variable')
509+
plt.ylabel('Predicted or known target values')
508510
plt.legend(loc='upper left')
509511

510512
plt.tight_layout()
511-
#plt.savefig('images/10_10.png', dpi=300)
513+
plt.savefig('images/10_10.png', dpi=300)
512514
plt.show()
513515

514516

Diff for: ch10/images/10_10.png

25.8 KB
Loading

Diff for: ch11/ch11.ipynb

+9-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,15 @@
6464
"cell_type": "markdown",
6565
"metadata": {},
6666
"source": [
67-
"*The use of `watermark` is optional. You can install this IPython extension via \"`pip install watermark`\". For more information, please see: https://github.com/rasbt/watermark.*"
67+
"*The use of `watermark` is optional. You can install this Jupyter extension via* \n",
68+
"\n",
69+
" conda install watermark -c conda-forge \n",
70+
"\n",
71+
"or \n",
72+
"\n",
73+
" pip install watermark \n",
74+
"\n",
75+
"*For more information, please see: https://github.com/rasbt/watermark.*"
6876
]
6977
},
7078
{

0 commit comments

Comments
 (0)