You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: book/book.tex
+13-7Lines changed: 13 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -13,7 +13,7 @@
13
13
\newcommand{\thetitle}{Modeling and Simulation in Python}
14
14
\newcommand{\thesubtitle}{}
15
15
\newcommand{\theauthors}{Allen B. Downey}
16
-
\newcommand{\theversion}{3.4.1}
16
+
\newcommand{\theversion}{3.4.2}
17
17
18
18
19
19
%%%% Both LATEX and PLASTEX
@@ -445,7 +445,7 @@ \section{Installing Python}
445
445
446
446
\section{Copying my files}
447
447
448
-
The simplest way to get the files for this book is to download a Zip archive from \url{http://modsimpy.com/zip}. You will need a program like WinZip or gzip to unpack the Zip file. Make a note of the location of the files you download.
448
+
The simplest way to get the files for this book is to download a Zip archive from \url{http://modsimpy.com/zip}. You will need a program like WinZip or gzip to unpack the Zip file. Make a note of the location of the files you unpack.
449
449
450
450
If you download the Zip file, you can skip the rest of this section, which explains how to use Git.
451
451
@@ -494,10 +494,16 @@ \section{Running Jupyter}
494
494
495
495
\index{Jupyter}
496
496
497
-
To start Jupyter on macOS or Linux, open a Terminal; on Windows, open Git Bash. Use \py{cd} to ``change directory" into the code directory in the repository:
497
+
To start Jupyter on macOS or Linux, open a Terminal; on Windows, open Git Bash. Use \py{cd} to ``change directory" into the directory in the repository that contains the notebooks. If you downloaded the Zip file, it's probably:
498
498
499
499
\begin{code}
500
-
cd ModSimPy/code
500
+
cd ModSimPy-master/notebooks
501
+
\end{code}
502
+
503
+
If you cloned it with Git, it's probably:
504
+
505
+
\begin{code}
506
+
cd ModSimPy/notebooks
501
507
\end{code}
502
508
503
509
Then launch the Jupyter notebook server:
@@ -506,7 +512,7 @@ \section{Running Jupyter}
506
512
jupyter notebook
507
513
\end{code}
508
514
509
-
Jupyter should open a window in a browser, and you should see the list of notebooks in my repository. Click on the first notebook, \py{chap01.ipynb} and follow the instructions to run the first few ``cells". The first time you run a notebook, it might take several seconds to start, while some Python files get initialized. After that, it should run faster.
515
+
Jupyter should open a window in a browser, and you should see the list of notebooks in my repository. Click on the first notebook, \py{chap01.ipynb} and follow the instructions to run the first few ``cells". The first time you run a notebook, it might take several seconds to start while some Python files get initialized. After that, it should run faster.
510
516
511
517
Feel free to read through the notebook, but it might not make sense until you read Chapter~\ref{chap01}.
512
518
@@ -935,7 +941,7 @@ \section{Print statements}
935
941
936
942
\begin{python}
937
943
def bike_to_wellesley():
938
-
print('Moving a bike to Wellesley')
944
+
print('Moving a bike to Wellesley')
939
945
bikeshare.olin -= 1
940
946
bikeshare.wellesley += 1
941
947
\end{python}
@@ -1395,7 +1401,7 @@ \section{Negative bikes}
1395
1401
state.olin += 1
1396
1402
\end{python}
1397
1403
1398
-
The first line checks whether the number of bikes at Wellesley is zero. If so, it uses a a {\bf return statement}, which causes the function to end immediately, without running the rest of the statements. So if there are no bikes at Wellesley, we ``return" from \py{bike_to_olin} without changing the state.
1404
+
The first line checks whether the number of bikes at Wellesley is zero. If so, it uses a {\bf return statement}, which causes the function to end immediately, without running the rest of the statements. So if there are no bikes at Wellesley, we ``return" from \py{bike_to_olin} without changing the state.
0 commit comments