diff --git a/README.md b/README.md index d5194ad..f2af271 100644 --- a/README.md +++ b/README.md @@ -1,13 +1,7 @@ -**NOTE:** If you're trying to run the RollDieDynamic.py script in Chapter 1 and the window does not appear, this is due to a known issue in the software for which a fix is already in process. You can instead run the program with - ->`ipython -i RollDieDynamic.py 6000 1` - -Then terminate IPython interactive mode (Ctrl + D twice) after you close the script's window. - -# PythonForProgrammers +# Python for Programmers This repository contains the source code and supporting files associated with our book Python for Programmers, which is a subset of our book Intro to Python for Computer Science and Data Science: Learning to Program with AI, Big Data and the Cloud. -![Cover image for Python for Programmers](http://deitel.com/bookresources/PythonFP/PythonForProgrammersCover.png) +![Cover image for Python for Programmers](https://deitel.com/wp-content/uploads/2020/01/python-for-programmers.jpg) These files are Copyright 2019 by Pearson Education, Inc. All Rights Reserved. diff --git a/examples/ch01/RollDieDynamic.py b/examples/ch01/RollDieDynamic.py index ebb6c48..433d08a 100755 --- a/examples/ch01/RollDieDynamic.py +++ b/examples/ch01/RollDieDynamic.py @@ -14,7 +14,7 @@ def update(frame_number, rolls, faces, frequencies): # reconfigure plot for updated die frequencies plt.cla() # clear old contents contents of current Figure - axes = sns.barplot(faces, frequencies, palette='bright') # new bars + axes = sns.barplot(x=faces, y=frequencies, palette='bright') # new bars axes.set_title(f'Die Frequencies for {sum(frequencies):,} Rolls') axes.set(xlabel='Die Value', ylabel='Frequency') axes.set_ylim(top=max(frequencies) * 1.10) # scale y-axis by 10% diff --git a/examples/ch05/snippets_ipynb/05_09.ipynb b/examples/ch05/snippets_ipynb/05_09.ipynb index 289fe9e..87576fd 100755 --- a/examples/ch05/snippets_ipynb/05_09.ipynb +++ b/examples/ch05/snippets_ipynb/05_09.ipynb @@ -148,7 +148,7 @@ "outputs": [], "source": [ "if key in numbers:\n", - " print(f'found {key} at index {numbers.index(search_key)}')\n", + " print(f'found {key} at index {numbers.index(key)}')\n", "else:\n", " print(f'{key} not found')" ] @@ -204,4 +204,4 @@ }, "nbformat": 4, "nbformat_minor": 2 -} +} \ No newline at end of file diff --git a/examples/ch05/snippets_py/05_09.py b/examples/ch05/snippets_py/05_09.py index 7f7765e..60739bc 100755 --- a/examples/ch05/snippets_py/05_09.py +++ b/examples/ch05/snippets_py/05_09.py @@ -29,7 +29,7 @@ key = 1000 if key in numbers: - print(f'found {key} at index {numbers.index(search_key)}') + print(f'found {key} at index {numbers.index(key)}') else: print(f'{key} not found') diff --git a/examples/ch06/RollDieDynamic.py b/examples/ch06/RollDieDynamic.py index c7bf9ae..9257e69 100755 --- a/examples/ch06/RollDieDynamic.py +++ b/examples/ch06/RollDieDynamic.py @@ -14,7 +14,7 @@ def update(frame_number, rolls, faces, frequencies): # reconfigure plot for updated die frequencies plt.cla() # clear old contents contents of current Figure - axes = sns.barplot(faces, frequencies, palette='bright') # new bars + axes = sns.barplot(x=faces, y=frequencies, palette='bright') # new bars axes.set_title(f'Die Frequencies for {sum(frequencies):,} Rolls') axes.set(xlabel='Die Value', ylabel='Frequency') axes.set_ylim(top=max(frequencies) * 1.10) # scale y-axis by 10%