Chapter 5 (About) of the book discusses working with mathematical sets in
-Python. While writing the chapter, I had a choice of whether to
-use Python 3's built-in set data
-structure or use SymPy's (0.7.6 +) FiniteSet class. I decided to go ahead
-with the latter. My choice is briefly explained towards the end of
-this post, but hopefully it will be clear before that.
-
Next, I describe how you can use Python 3's built-in set data
-structure to create sets and perform set operations such as finding
-the union, intersection or cartesian product of sets. For comparison,
-I also show how you can do the same using SymPy's FiniteSet class.
-
-
Creating a set
-
We can create a set consisting of the elements {1, 2, 3} in Python 3
-as follows:
-
>>>s1={1,2,3}
->>>s1
-{1,2,3}
-
-
To create a set when the elements are already in a list (for
-example), we would use the following syntax:
To create an empty set,
-in Python 3 you would use create an empty set object:
-
>>>e=set()
->>>e
-set()
-
-
In SymPy, an empty set is represented by an EmptySet object. Thus,
-you can either create an empty set by directly creating an
-EmptySet object or by creating a FiniteSet object without
-specifying any set members, like so:
The intersection() method can be used to find the intersection of
-two or more sets created using either of the above approaches. Continuing
-with the above three sets:
However considering that the cartesian product of two sets should be another set,
-the product() function doesn't really then return the
-cartesian product itself, but (an iterator to) the elements in it. Hence, if we
-try to apply the result returned by the function directly to a method or
-function which is expected to be applicable to a set, it will fail. For
-example, itertools.product(s1, s2).union(s3) will result in an error, but
-set(itertools.product(s1, s2)).union(s3) will work.
-
Using SymPy's FiniteSet, you can use the *
-(multiplication or product) operator to find the cartesian product
-and the result is a set itself. Thus, it is closer to what
-a cartesian product is mathematically. An example follows:
To find the cartesian product of a set with itself, i.e. s1*s1 for
-example, we pass in a keyword argument, repeat while calling the
-itertools.product() function. The value of repeat is the
-power we want to raise the set to. Thus, itertools.product(s1,
-repeat=2) will calculate the cartesian product, s1*s1:
The issubset() and issuperset() methods are available for sets
-created via either approaches to check if a set is a subset and super
-set of another, respectively. Thus, s1.issubset(s2) will check if
-s1 is a subset of s2.
-
Checking for proper subset and superset
-
To check if a set, s1 is a proper subset of another set,
-s2 when using built-in set, we can do the following:
In SymPy, we have is_proper_subset() and is_proper_superset()
-methods which can be used to check if a set is a proper subset or
-superset of another, respectively. Thus, the above would be written as
-s1.is_proper_subset(s2).
-
-
-
Calculating the powerset
-
For sets created via built-in set data structure, there is no
-direct method available to create the power set. However, you can use the
-powerset recipe described in the itertools documentation.
-
On the other hand, in SymPy, there is a powerset() method
-available which returns the power set:
You can see that the powerset() method returns the power set and not the
-elements in it.
-
-
-
Choice of SymPy's FiniteSet over set
-
From the above comparison, we can see that SymPy's FiniteSet
-provides us with nice features such as being able to use the *
-operator to find the cartesian product, ** operator to calculate
-the cartesian product with itself and powerset() method for calculating the
-power set. These are not present when using the built-in set data
-structure. This was certainly a big driving factor in my choice,
-since SymPy was also being used in other chapters of the book.
-
However, a key reason for my choice was that I wanted to show how we
-can create sets which did not allow addition or removal once created -
-like mathematical sets. This need was fulfilled by SymPy's
-FiniteSet since it used Python's frozenset data structure and
-not the set data sturcture.
-
The alternative to that would have
-been to use frozenset directly, but I just did not like the idea
-of it and I would have also missed out on the nice features
-FiniteSet would provide (eventually). I should note here that once
-I had made the decision to go with FiniteSet, I contributed patches
-to SymPy to make the methods of FiniteSet more compatible with Python's built in set
-and also implement minor features I discussed above.
(Thanks to Dan Wolfe for informing me of the incorrect command to install anaconda=5.0)
-
A fresh installation of Anaconda 5.0 should still be similar to the instructions
-for earlier versions.
-
-
-
-
-
-
-
-
-
-
-
-
-
I have so far verified both on Mac OS X and Linux. If you find any
-issues on Windows, please email me at
-doingmathwithpython@gmail.com or post your query/tip to any of the
-following community forums:
In Chapter 3 on Page 87, the book refers to the Google Correlate service. However, as of December 2019, the service has been shutdown.
-Since the chapter requires you to download a CSV formatted data, it is no longer possible. However, you can instead download a version of
-the data …
I am very excited to share that "Doing Math with Python" is part of No Starch Press's Coding Starter Humble Bundle.
-Of course, you get No Starch Press's other excellent coding books as part of the bundle.
Hi all, I am very excited to announce that the book is now available for
-purchase in print and electronic formats from various online stores
-including Amazon
-and No Starch Press.
-Please see the Buy page for others.
-
-
If you are keen to take a look at the contents and read a sample
-chapter, please head over to No Starch's book page.
-
Alternatively, if you are keen to recieve a review copy, please email
-doingmathwithpython@gmail.com and I will try to request one from the
-publishers.
-
-
Stay in touch
-
You can stay connected with the book, its readers and me via the
-following channels:
The first code snippet above is an example of breaking a long line into two (or more) lines so that we don't end up with really long lines in our code. How long should a line be when you should think about breaking it? If your statement's length is more than 80 characters, you should think about breaking it up.
-
In the book, we often had to do so because of layout reasons even though the statement may not have exceeded 80 characters, and in your projects you will want to do it so that your statements are easier to read and on the average all lines have a similar length. This is formalized (among other things) in PEP 8.
-
Note that the examples below will for illustrative purposes break lines waaaaay less than 80 characters.
-
-
How do you break?
-
-
When not calling function
-
When you are not calling a function, you essentially have two choices:
-
Use paranthesis
-
This is exactly how we break the long statement in the example we started this article with. For the moment ignore the call to print() and assume that the statement is:
The line continuation operator, \ can be used to split long statements over multiple lines. Here is how we could split the above statement using \ instead:
At the end of every line (except the last), we just add a \ indicating that the next line is also a part of the same statement.
-
Breaking up those long if statements
-
Often I have to break long if statements and is in fact one of the most common cases I face at work where I have to break the statement into multiple lines. Here is an example using both the approaches above:
-
-# Using parenthesis
-if (cond1 and cond2 and cond3
- and cond4):
- # True block
-else:
- # False block
-
-# Using line continuation operator
-if cond1 and cond2 and cond3 \
- and cond4:
- # True block
-else:
- # False block
-
-
-
-
When calling functions
-
By default, when calling functions you can just press enter and without doing anything more keep writing your statement over multiple lines. For example:
-
-x = 1
-print(x,
- x)
-
-
Hence, we could have broken the first example we saw as:
When calling format() we put the arguments over separate lines.
-
-
-
-
Learning more about Python coding style
-
If you liked reading this article, you may also find it worth your time going over the Python style guide. You may even find instances where I have not followed a guideline when writing the programs in the book. If you find one, let me know.
In Chapter 3 on Page 87, the book refers to the Google Correlate service. However, as of December 2019, the service has been shutdown.
-Since the chapter requires you to download a CSV formatted data, it is no longer possible. However, you can instead download a version of
-the data …
I am very excited to share that "Doing Math with Python" is part of No Starch Press's Coding Starter Humble Bundle.
-Of course, you get No Starch Press's other excellent coding books as part of the bundle.
In Chapter 3 on Page 87, the book refers to the Google Correlate service. However, as of December 2019, the service has been shutdown.
-Since the chapter requires you to download a CSV formatted data, it is no longer possible. However, you can instead download a version of
-the data that I had used 5 years back when writing the book from
-here.
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/content/.DS_Store b/content/.DS_Store
new file mode 100644
index 0000000..ca3c249
Binary files /dev/null and b/content/.DS_Store differ
diff --git a/content/anaconda-4.0-sympy-1.0.rst b/content/anaconda-4.0-sympy-1.0.rst
new file mode 100644
index 0000000..e97bf0b
--- /dev/null
+++ b/content/anaconda-4.0-sympy-1.0.rst
@@ -0,0 +1,31 @@
+SymPy 1.0 and Anaconda 4.0 releases
+===================================
+
+:date: 2016-04-11 19:50
+:category: updates
+:slug: sympy-1.0-anaconda-4.0
+:summary: sympy 1.0 and Anaconda 4.0
+
+`SymPy 1.0 `__ was released recently and `Anaconda 4.0
+`__
+was just released. I tried all the `sample solutions
+`__
+and everything works as expected. The `chapter programs
+`__ should
+keep working as well.
+
+You can get both the updates when you install Anaconda 4.0 or updated
+your existing Anaconda installation:
+
+.. code::
+
+ $ conda update conda
+ $ conda update anaconda
+
+I have so far verified both on Mac OS X and Linux. If you find any
+issues on Windows, please email me at
+``doingmathwithpython@gmail.com`` or post your query/tip to any of the
+following community forums:
+
+- `Facebook page `__
+- `G+ Community `__
diff --git a/content/anaconda-5.0.rst b/content/anaconda-5.0.rst
new file mode 100644
index 0000000..d6b9199
--- /dev/null
+++ b/content/anaconda-5.0.rst
@@ -0,0 +1,61 @@
+Anaconda 5.0 release
+====================
+
+:date: 2017-10-29 19:50
+:category: updates
+:slug: anaconda-5.0
+:summary: Anaconda 5.0 release
+
+`Anaconda 5.0 `__
+was released a few days back. I tried all the `sample solutions
+`__
+and everything works as expected. The `chapter programs
+`__ should
+keep working as well.
+
+The versions of the relevant software in this release are:
+
+- Python 3.6
+- sympy 1.1.1
+- matplotlib 2.1.0
+
+You can update your existing installation using:
+
+.. code::
+
+ $ conda update conda
+ $ conda install anaconda=5.0
+
+(Thanks to Dan Wolfe for informing me of the incorrect command to install `anaconda=5.0`)
+
+A fresh installation of Anaconda 5.0 should still be similar to the `instructions `__
+for earlier versions.
+
+.. figure:: {filename}/images/anaconda-5.png
+ :align: center
+ :alt: Anaconda 5
+
+.. figure:: {filename}/images/anaconda-install-1.png
+ :align: center
+ :alt: Anaconda 5
+ :scale: 50%
+
+.. figure:: {filename}/images/anaconda-install-2.png
+ :align: center
+ :alt: Anaconda 5
+ :scale: 50%
+
+.. figure:: {filename}/images/anaconda-install-3.png
+ :align: center
+ :alt: Anaconda 5
+ :scale: 50%
+
+
+I have so far verified both on Mac OS X and Linux. If you find any
+issues on Windows, please email me at
+``doingmathwithpython@gmail.com`` or post your query/tip to any of the
+following community forums:
+
+- `Facebook page `__
+- `G+ Community `__
+
diff --git a/content/breaking-long-lines.rst b/content/breaking-long-lines.rst
new file mode 100644
index 0000000..84b4c29
--- /dev/null
+++ b/content/breaking-long-lines.rst
@@ -0,0 +1,146 @@
+Breaking long lines in Python
+-----------------------------
+:date: 2015-11-04 12:00
+:category: articles
+:slug: breaking-long-lines-in-python
+:summary: Breaking long lines in Python
+
+
+
+In some of the programs discussed in the book including the sample solutions, you will see statements like:
+
+.. code::
+
+ print('Area: {0}, Estimated ({1}): {2}'.
+ format(area_of_circle, points, estimate(radius, points)))
+
+
+This is really the following single statement:
+
+.. code::
+
+ print('Area: {0}, Estimated ({1}): {2}'.format(area_of_circle, points, estimate(radius, points)))
+
+The first code snippet above is an example of breaking a long line into two (or more) lines so that we don't end up with really long lines in our code. How long should a line be when you should think about breaking it? If your statement's length is more than 80 characters, you should think about breaking it up.
+
+In the book, we often had to do so because of layout reasons even though the statement may not have exceeded 80 characters, and in your projects you will want to do it so that your statements are easier to read and on the average all lines have a similar length. This is formalized (among other things) in `PEP 8 `__.
+
+Note that the examples below will for illustrative purposes break lines waaaaay less than 80 characters.
+
+How do you break?
+=================
+
+When not calling function
+~~~~~~~~~~~~~~~~~~~~~~~~~
+
+When you are not calling a function, you essentially have two choices:
+
+**Use paranthesis**
+
+This is exactly how we break the long statement in the example we started this article with. For the moment ignore the call to ``print()`` and assume that the statement is:
+
+.. code::
+
+ s = 'Area: {0}, Estimated ({1}): {2}'.format(area_of_circle, points, estimate(radius, points))
+
+This essentially just creates the string ``s``. If we were to split this statement over multiple lines, we would do the following:
+
+.. code::
+
+ s = ('Area: {0}, Estimated ({1}): {2}'
+ .format(area_of_circle, points, estimate(radius, points)))
+
+Note the extra beginning and the ending parenthesis.
+
+Here is another example:
+
+.. code::
+
+ s1 = x + x**2/2 + x**3/3 + x**4/4 + x**5/5 + x**6/6 + x**7/7 + x**8/8
+
+Here is how we can use split the above statment into multiple lines using parentheses:
+
+.. code::
+
+ s3 = (x + x**2/2 + x**3/3
+ + x**4/4 + x**5/5
+ + x**6/6 + x**7/7
+ + x**8/8)
+
+**Use the line continuation operator**
+
+The line continuation operator, ``\`` can be used to split long statements over multiple lines. Here is how we could split the above statement using ``\`` instead:
+
+.. code::
+
+ s3 = x + x**2/2 + x**3/3 \
+ + x**4/4 + x**5/5 \
+ + x**6/6 + x**7/7 \
+ + x**8/8
+
+
+At the end of every line (except the last), we just add a ``\`` indicating that the next line is also a part of the same statement.
+
+**Breaking up those long if statements**
+
+Often I have to break long ``if`` statements and is in fact one of the most common cases I face at work where I have to break the statement into multiple lines. Here is an example using both the approaches above:
+
+.. code::
+
+ # Using parenthesis
+ if (cond1 and cond2 and cond3
+ and cond4):
+ # True block
+ else:
+ # False block
+
+ # Using line continuation operator
+ if cond1 and cond2 and cond3 \
+ and cond4:
+ # True block
+ else:
+ # False block
+
+
+
+When calling functions
+~~~~~~~~~~~~~~~~~~~~~~
+
+By default, when calling functions you can just press enter and without doing anything more keep writing your statement over multiple lines. For example:
+
+.. code::
+
+ x = 1
+ print(x,
+ x)
+
+
+Hence, we `could` have broken the first example we saw as:
+
+.. code::
+
+ print('Area: {0}, Estimated ({1}): {2}'.format(area_of_circle,
+ points,
+ estimate(radius, points)))
+
+When calling ``format()`` we put the arguments over separate lines.
+
+Learning more about Python coding style
+=======================================
+
+If you liked reading this article, you may also find it worth your time going over the `Python style guide `__. You may even find instances where I have not followed a guideline when writing the programs in the book. If you find one, let me know.
+
+
+Getting in touch
+================
+
+Stay updated or get in touch:
+
+- `Facebook page `__
+- `G+ Community `__
+- `Twitter `__
+
+You can contact me directly via:
+
+- Twitter: `@mathwithpython `__
+- Email : doingmathwithpython@gmail.com
diff --git a/content/code-and-errata.rst b/content/code-and-errata.rst
new file mode 100644
index 0000000..6b87a50
--- /dev/null
+++ b/content/code-and-errata.rst
@@ -0,0 +1,26 @@
+Chapter code and Errata
+=======================
+:date: 2015-09-11 08:20
+:category: updates
+:slug: chapter-code-errata
+:summary: Chapter code and errata
+
+
+You can find the chapter programs and snippets linked from the `programs
+<{filename}pages/chapter_programs.rst>`__ page. They should be free
+from any error mentioned on the `errata <{filename}pages/errata.rst>`__ page.
+
+Stay in touch
+~~~~~~~~~~~~~
+
+You can stay connected with the book, its readers and me via the
+following channels:
+
+- `Facebook page `__
+- `G+ Community `__
+- `Twitter `__
+
+You can contact me directly via:
+
+- Twitter: `@mathwithpython `__
+- Email : doingmathwithpython@gmail.com
diff --git a/content/coding-starter-kit-humble-bundle.rst b/content/coding-starter-kit-humble-bundle.rst
new file mode 100644
index 0000000..6538d96
--- /dev/null
+++ b/content/coding-starter-kit-humble-bundle.rst
@@ -0,0 +1,22 @@
+Coding Starter Kit Humble Bundle
+================================
+
+:date: 2020-03-17
+:category: updates
+:slug: humble-bundle-coding-starter
+
+I am very excited to share that "Doing Math with Python" is part of No Starch Press's `Coding Starter Humble Bundle `__.
+Of course, you get No Starch Press's other excellent coding books as part of the bundle.
+
+It's on for the next 20 days!
+
+
+.. figure:: {filename}/images/coding-starter-humble-bundle.png
+ :align: left
+ :alt: Humble Bundle
+ :scale: 10%
+
+Your purchases will help support the No Starch Foundation and Scratch Foundation.
+
+
+Get the bundle `here `__.
diff --git a/content/data-science-humble-bundle.rst b/content/data-science-humble-bundle.rst
new file mode 100644
index 0000000..8fe02ab
--- /dev/null
+++ b/content/data-science-humble-bundle.rst
@@ -0,0 +1,21 @@
+Doing Math with Python in Data Science Humble Bundle
+====================================================
+:date: 2023-10-25 13:20
+:category: updates
+:slug: humble-bundle-data-science
+:summary: Humble bundle
+
+"Doing Math with Python" is part of No Starch Press's `Data Science Humble Bundle `__
+running for the next 19 days. Your purchases will help support EFF!
+
+
+.. figure:: {filename}/images/data-science-humble-bundle.png
+ :align: center
+ :alt: Humble Bundle
+ :scale: 10%
+
+
+Get the bundle `here `__!
+
+I am still surprised that the book still continues to be relevant, and i am quietly happy that I could produce such a book,
+thanks to all the help i got from No Starch folks.
diff --git a/content/doing-math-humble-bundle.rst b/content/doing-math-humble-bundle.rst
new file mode 100644
index 0000000..7191158
--- /dev/null
+++ b/content/doing-math-humble-bundle.rst
@@ -0,0 +1,19 @@
+Doing Math with Python Humble Bundle
+====================================
+:date: 2017-04-06 08:20
+:category: updates
+:slug: humble-bundle
+:summary: Humble bundle
+
+No Starch Press has launched a "Pay what you want" `Python Humble Bundle `__ running from April 5th - April 19th!
+Your purchases will help support the Python Software Foundation and I am excited to announce that Doing Math with Python is part of it.
+
+.. figure:: {filename}/images/humble-bundle.png
+ :align: center
+ :alt: Humble Bundle
+ :scale: 50%
+
+
+For 1+ USD you can get three books including "Doing Math with Python"! For 15+ USD you get nine excellent Python books!
+
+Get the bundle `here `__!
diff --git a/content/doing-math-out.rst b/content/doing-math-out.rst
new file mode 100644
index 0000000..da5c5cf
--- /dev/null
+++ b/content/doing-math-out.rst
@@ -0,0 +1,42 @@
+Doing Math with Python Available now!
+=====================================
+
+:date: 2015-09-02 08:00
+:category: updates
+:slug: available-now
+:summary: Available now!
+
+Hi all, I am very excited to announce that the book is now available for
+purchase in print and electronic formats from various online stores
+including `Amazon
+`__
+and `No Starch Press `__.
+Please see the `Buy <{filename}pages/buy.rst>`__ page for others.
+
+.. image:: {filename}/images/cover.png
+ :align: center
+ :target: http://www.nostarch.com/doingmathwithpython
+ :alt: Book cover
+
+If you are keen to take a look at the contents and read a sample
+chapter, please head over to `No Starch's book page
+`__.
+
+Alternatively, if you are keen to recieve a review copy, please email
+`doingmathwithpython@gmail.com` and I will try to request one from the
+publishers.
+
+Stay in touch
+~~~~~~~~~~~~~
+
+You can stay connected with the book, its readers and me via the
+following channels:
+
+- `Facebook page `__
+- `G+ Community `__
+- `Twitter `__
+
+You can contact me directly via:
+
+- Twitter: `@mathwithpython `__
+- Email : doingmathwithpython@gmail.com
diff --git a/content/doing-math-with-python-coders-bookhself.rst b/content/doing-math-with-python-coders-bookhself.rst
new file mode 100644
index 0000000..ba1332d
--- /dev/null
+++ b/content/doing-math-with-python-coders-bookhself.rst
@@ -0,0 +1,18 @@
+Doing Math with Python in Coder's Bookshelf Humble Bundle
+=========================================================
+:date: 2019-03-29
+:category: updates
+:slug: humble-bundle-coders-bookshelf
+:summary: Humble bundle
+
+"Doing Math with Python" is part of No Starch Press's "Pay what you want" `Coder's Bookshelf Bundle `__.
+Your purchases will help support a charity of your choice.
+
+
+.. figure:: {filename}/images/humble-bundle-3.png
+ :align: center
+ :alt: Humble Bundle
+ :scale: 25%
+
+
+Get the bundle `here `__!
diff --git a/content/doing-math-with-python-linux-geek-humble-bundle.rst b/content/doing-math-with-python-linux-geek-humble-bundle.rst
new file mode 100644
index 0000000..e06b8ca
--- /dev/null
+++ b/content/doing-math-with-python-linux-geek-humble-bundle.rst
@@ -0,0 +1,18 @@
+Doing Math with Python in Linux Geek Humble Bundle
+==================================================
+:date: 2018-07-24 13:20
+:category: updates
+:slug: humble-bundle-linux-geek
+:summary: Humble bundle
+
+"Doing Math with Python" is part of No Starch Press's "Pay what you want" `Linux Geek Humble Bundle `__
+running for the next 7 days. Your purchases will help support EFF or a charity of your choice.
+
+
+.. figure:: {filename}/images/humble-bundle-2.png
+ :align: center
+ :alt: Humble Bundle
+ :scale: 10%
+
+
+Get the bundle `here `__!
diff --git a/content/education-summit.rst b/content/education-summit.rst
new file mode 100644
index 0000000..84ecb24
--- /dev/null
+++ b/content/education-summit.rst
@@ -0,0 +1,77 @@
+Python 2016 Education Summit Notes
+==================================
+
+:date: 2016-05-29 17:00
+:category: updates
+:slug: education-summit-pycon-2016
+:summary: Education Summit Summary
+
+I participated in the education summit today. My talk slides for "Doing Math with Python" is available `here `__.
+
+Here are some notes on the other talks I attended.
+
+Keynote
+~~~~~~~
+
+- Education WG
+- PythonZero
+- GPIO Zero
+- Network zero: https://github.com/tjguk/networkzero/
+- Zero: based on an established package, emphasis is on up-and-running use in a classroom, Relevant error messages
+
+Micro:bit
+
+- Mu, demos
+
+
+Lessons learned from teaching Python
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+- Put your work out there on the internet
+- Think about internationalization
+- Self publish Amazon's create space, Kindle
+- Quizzes, collect data, data mining
+- Instructor section
+- Online markup of code
+- EpicPen
+- YouTube channel
+- Libraries: Pygame, Arcade
+
+Pyzero
+~~~~~~
+
+- Demos
+- pzrun
+
+
+Minecraft with Python
+~~~~~~~~~~~~~~~~~~~~~
+
+- Use Python to interact with Minecraft
+- CoderDojo Minecraft bundle
+- Using Jupyter Notebooks
+
+PyCharm Edu
+~~~~~~~~~~~
+
+- Courses
+- Checkout PyCharm EDU for creating courses
+
+Teaching data structures with Python
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+- Python makes the teacher happy
+- Lab only
+- Algorithms in Python + C (Side by side)
+- Two languages worked well for them.
+- Low level language: easy to find the complexity of the algorithm
+- High level language: hard to find the complexity of the algorithm
+
+Merlin for Data Science Education
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+- Where to even start?
+- Effort justification
+- Spending 2hr out of a 8hr session in fixing something is not worth it
+- Shouldn't be proud of battling with tool set rather than not doing the real work
+- Merlin - http://www.darklabsdatascience.com/project_merlin/
diff --git a/content/google-correlate-chap3.rst b/content/google-correlate-chap3.rst
new file mode 100644
index 0000000..1c31ad6
--- /dev/null
+++ b/content/google-correlate-chap3.rst
@@ -0,0 +1,13 @@
+Chapter 3 - Google Correlate example update
+===========================================
+
+:date: 2020-07-11
+:category: updates
+
+In Chapter 3 on Page 87, the book refers to the Google Correlate service. However, as of December 2019, the service has been shutdown.
+Since the chapter requires you to download a CSV formatted data, it is no longer possible. However, you can instead download a version of
+the data that I had used 5 years back when writing the book from
+`here `__.
+
+Thanks to a reader for pointing me to this issue.
+
diff --git a/content/hello.rst b/content/hello.rst
new file mode 100644
index 0000000..688d95d
--- /dev/null
+++ b/content/hello.rst
@@ -0,0 +1,27 @@
+Introduction to "Doing Math with Python"
+========================================
+
+:date: 2015-05-24 23:27
+:category: updates
+:slug: hello-world
+:summary: Hello World
+
+Hi all, this is the blog for my book "Doing Math with Python".
+
+.. image:: {filename}/images/cover.png
+ :align: center
+ :target: http://www.nostarch.com/doingmathwithpython
+ :alt: Book cover
+
+The first six chapters of the book are already available via the
+publisher's early access program. You can learn briefly about each
+chapter on the `About <{filename}pages/about.rst>`__ page.
+Going forward, I will be sharing updates regarding the book and posting
+original content related to that discussed in the book.
+
+You can stay connected with the book, its readers and me via the
+following channels:
+
+- `Facebook page `__
+- `G+ Community `__
+- `Twitter `__
diff --git a/images/20160529_105333.jpg b/content/images/20160529_105333.jpg
similarity index 100%
rename from images/20160529_105333.jpg
rename to content/images/20160529_105333.jpg
diff --git a/images/20160529_143827.jpg b/content/images/20160529_143827.jpg
similarity index 100%
rename from images/20160529_143827.jpg
rename to content/images/20160529_143827.jpg
diff --git a/images/20160529_154931.jpg b/content/images/20160529_154931.jpg
similarity index 100%
rename from images/20160529_154931.jpg
rename to content/images/20160529_154931.jpg
diff --git a/images/20160529_155914.jpg b/content/images/20160529_155914.jpg
similarity index 100%
rename from images/20160529_155914.jpg
rename to content/images/20160529_155914.jpg
diff --git a/images/anaconda-5.png b/content/images/anaconda-5.png
similarity index 100%
rename from images/anaconda-5.png
rename to content/images/anaconda-5.png
diff --git a/images/anaconda-install-1.png b/content/images/anaconda-install-1.png
similarity index 100%
rename from images/anaconda-install-1.png
rename to content/images/anaconda-install-1.png
diff --git a/images/anaconda-install-2.png b/content/images/anaconda-install-2.png
similarity index 100%
rename from images/anaconda-install-2.png
rename to content/images/anaconda-install-2.png
diff --git a/images/anaconda-install-3.png b/content/images/anaconda-install-3.png
similarity index 100%
rename from images/anaconda-install-3.png
rename to content/images/anaconda-install-3.png
diff --git a/images/anaconda-install-4.png b/content/images/anaconda-install-4.png
similarity index 100%
rename from images/anaconda-install-4.png
rename to content/images/anaconda-install-4.png
diff --git a/images/coding-starter-humble-bundle.png b/content/images/coding-starter-humble-bundle.png
similarity index 100%
rename from images/coding-starter-humble-bundle.png
rename to content/images/coding-starter-humble-bundle.png
diff --git a/images/cover.png b/content/images/cover.png
similarity index 100%
rename from images/cover.png
rename to content/images/cover.png
diff --git a/images/data-science-humble-bundle.png b/content/images/data-science-humble-bundle.png
similarity index 100%
rename from images/data-science-humble-bundle.png
rename to content/images/data-science-humble-bundle.png
diff --git a/images/humble-bundle-2.png b/content/images/humble-bundle-2.png
similarity index 100%
rename from images/humble-bundle-2.png
rename to content/images/humble-bundle-2.png
diff --git a/images/humble-bundle-3.png b/content/images/humble-bundle-3.png
similarity index 100%
rename from images/humble-bundle-3.png
rename to content/images/humble-bundle-3.png
diff --git a/images/humble-bundle.png b/content/images/humble-bundle.png
similarity index 100%
rename from images/humble-bundle.png
rename to content/images/humble-bundle.png
diff --git a/images/idle-1.png b/content/images/idle-1.png
similarity index 100%
rename from images/idle-1.png
rename to content/images/idle-1.png
diff --git a/images/idle-2.png b/content/images/idle-2.png
similarity index 100%
rename from images/idle-2.png
rename to content/images/idle-2.png
diff --git a/images/install/mac1.png b/content/images/install/mac1.png
similarity index 100%
rename from images/install/mac1.png
rename to content/images/install/mac1.png
diff --git a/images/install/mac10.png b/content/images/install/mac10.png
similarity index 100%
rename from images/install/mac10.png
rename to content/images/install/mac10.png
diff --git a/images/install/mac11.png b/content/images/install/mac11.png
similarity index 100%
rename from images/install/mac11.png
rename to content/images/install/mac11.png
diff --git a/images/install/mac2.png b/content/images/install/mac2.png
similarity index 100%
rename from images/install/mac2.png
rename to content/images/install/mac2.png
diff --git a/images/install/mac3.png b/content/images/install/mac3.png
similarity index 100%
rename from images/install/mac3.png
rename to content/images/install/mac3.png
diff --git a/images/install/mac4.png b/content/images/install/mac4.png
similarity index 100%
rename from images/install/mac4.png
rename to content/images/install/mac4.png
diff --git a/images/install/mac5.png b/content/images/install/mac5.png
similarity index 100%
rename from images/install/mac5.png
rename to content/images/install/mac5.png
diff --git a/images/install/mac6.png b/content/images/install/mac6.png
similarity index 100%
rename from images/install/mac6.png
rename to content/images/install/mac6.png
diff --git a/images/install/mac7.png b/content/images/install/mac7.png
similarity index 100%
rename from images/install/mac7.png
rename to content/images/install/mac7.png
diff --git a/images/install/mac8.png b/content/images/install/mac8.png
similarity index 100%
rename from images/install/mac8.png
rename to content/images/install/mac8.png
diff --git a/images/install/mac9.png b/content/images/install/mac9.png
similarity index 100%
rename from images/install/mac9.png
rename to content/images/install/mac9.png
diff --git a/images/install/windows1.png b/content/images/install/windows1.png
similarity index 100%
rename from images/install/windows1.png
rename to content/images/install/windows1.png
diff --git a/images/install/windows2.png b/content/images/install/windows2.png
similarity index 100%
rename from images/install/windows2.png
rename to content/images/install/windows2.png
diff --git a/images/install/windows3.png b/content/images/install/windows3.png
similarity index 100%
rename from images/install/windows3.png
rename to content/images/install/windows3.png
diff --git a/images/install/windows4.png b/content/images/install/windows4.png
similarity index 100%
rename from images/install/windows4.png
rename to content/images/install/windows4.png
diff --git a/images/install/windows5.png b/content/images/install/windows5.png
similarity index 100%
rename from images/install/windows5.png
rename to content/images/install/windows5.png
diff --git a/images/install/windows6.png b/content/images/install/windows6.png
similarity index 100%
rename from images/install/windows6.png
rename to content/images/install/windows6.png
diff --git a/images/install/windows7.png b/content/images/install/windows7.png
similarity index 100%
rename from images/install/windows7.png
rename to content/images/install/windows7.png
diff --git a/images/install/windows8.png b/content/images/install/windows8.png
similarity index 100%
rename from images/install/windows8.png
rename to content/images/install/windows8.png
diff --git a/images/install/windows9.png b/content/images/install/windows9.png
similarity index 100%
rename from images/install/windows9.png
rename to content/images/install/windows9.png
diff --git a/images/jupyter-notebook-1/image1.png b/content/images/jupyter-notebook-1/image1.png
similarity index 100%
rename from images/jupyter-notebook-1/image1.png
rename to content/images/jupyter-notebook-1/image1.png
diff --git a/images/python-humble-bundle-2.png b/content/images/python-humble-bundle-2.png
similarity index 100%
rename from images/python-humble-bundle-2.png
rename to content/images/python-humble-bundle-2.png
diff --git a/images/python-humble-bundle.png b/content/images/python-humble-bundle.png
similarity index 100%
rename from images/python-humble-bundle.png
rename to content/images/python-humble-bundle.png
diff --git a/images/trailing_zeros_formula.png b/content/images/trailing_zeros_formula.png
similarity index 100%
rename from images/trailing_zeros_formula.png
rename to content/images/trailing_zeros_formula.png
diff --git a/images/zip-extracted.png b/content/images/zip-extracted.png
similarity index 100%
rename from images/zip-extracted.png
rename to content/images/zip-extracted.png
diff --git a/content/introduction-to-jupyter-notebook.rst.draft b/content/introduction-to-jupyter-notebook.rst.draft
new file mode 100644
index 0000000..ce0f05b
--- /dev/null
+++ b/content/introduction-to-jupyter-notebook.rst.draft
@@ -0,0 +1,41 @@
+Introduction to Jupyter Notebook
+================================
+
+:date: 2016-05-24 19:50
+:category: articles
+:slug: introduction-to-jupyter-notebook
+:summary: Introduction to Jupyter Notebook
+
+Jupyter Notebook (formerly known as IPython notebook) is a browser based tool for Python programming. At the most basic level, it enables a rich browser based coding experience, letting you interleave code as well as the output. An example of a notebook containing the code from Chapter 6 of the book is `here `__.
+
+Starting the Jupyter Notebook server
+------------------------------------
+
+First, we need to start the Jupyter Notebok "server". If you have `Anaconda 4.x installed <{filename}post/anaconda-4.0-sympy-1.0.rst>`__ , you can start it using the "jupyter-notebook" command::
+
+.. code::
+
+ $ jupyter-notebook
+ [I 16:19:09.747 NotebookApp] Serving notebooks from local directory: /Users/asaha/work/dmwp/doingmathwithpython.github.io/content/notebooks
+ [I 16:19:09.747 NotebookApp] 0 active kernels
+ [I 16:19:09.747 NotebookApp] The Jupyter Notebook is running at: http://localhost:8888/
+ [I 16:19:09.747 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
+
+A browser tab/window should open similar to:
+
+.. figure:: {filename}/images/jupyter-notebook1/figure1.png
+ :align: center
+ :alt: Jupyter Notebook "homepage"
+
+Currently there are no notebooks in the directory ``/Users/asaha/work/dmwp/doingmathwithpython.github.io/content/notebooks`` which is where I started the server from, and hence we see an empty list in the browser window.
+
+Creating a notebook
+-------------------
+
+- Talk about cells
+- Code cell
+- Markdown cell
+- matplotlib inline
+- exporting
+- sharing
+- slides
diff --git a/content/off-to-press.rst b/content/off-to-press.rst
new file mode 100644
index 0000000..ce94060
--- /dev/null
+++ b/content/off-to-press.rst
@@ -0,0 +1,19 @@
+All chapters completed, off to the printers
+===========================================
+
+:date: 2015-08-15 23:27
+:category: updates
+:slug: off-to-printers
+:summary: off to printers!
+
+I am very excited to write that all the chapters has been completed
+and the book is currently with the printers! You can find out more
+about the contents (including a detailed table of contents) from the
+`About <{filename}pages/about.rst>`__ page.
+
+You can stay connected with the book, its readers and me via the
+following channels:
+
+- `Facebook page `__
+- `G+ Community `__
+- `Twitter `__
diff --git a/content/oreilly-webcast-doing-math-with-python.rst b/content/oreilly-webcast-doing-math-with-python.rst
new file mode 100644
index 0000000..54f0e2a
--- /dev/null
+++ b/content/oreilly-webcast-doing-math-with-python.rst
@@ -0,0 +1,83 @@
+
+O'Reilly Webcast: Doing Math with Python
+========================================
+
+:date: 2016-07-01 14:00
+:category: updates
+:slug: oreilly-webcast-doing-math
+:summary: O'Reilly Webcast
+
+**Updated post after the webcast**
+
+A big thank you to all of you who turned up for the webcast across the world. I really had a great time and hope the session was informative to all of you. For those who didn't make it to the webcast, it's now available for `viewing `__.
+
+The slides, transcript and the demos are all available at the `GitHub repository `__. Feel free to use them in any capacity you find useful. If you already have `Anaconda installed `__, get the above code, and run `jupyter-notebook` from the same directory to be able to play with the code.
+
+*Links of Interest*
+
+- `Webcast Recording `__
+- `Slides, Transcript and Demos `__
+- `Doing Math with Python book `__
+
+
+
+Some of you asked a number of questions which I couldn't answer as well as I would have wanted to during the webcast, so I will make a better attempt below:
+
+**Q: What is the difference between an interpreter, ide and text editor? And what do you recommend for beginners?**
+
+An ``interpreter`` is what runs your program. Without going into the details, the Python interpreter is what converts a statement such as ``print("Hello")`` to a form that can be understood by the computer to finally print ``Hello`` on screen.
+An ``IDE`` or Integrated Development Environment is a software application where we can write programs and run them usually via Graphical User Interface. IDEs generally feature helpful features such as code completion and can be useful when working with large projects. A ``text editor`` is for writing our programs or other text. It usually doesn't support features that an IDE would support but of course, you can configure and enhance text editors to give you IDE-like features.
+
+For beginners, I recommend starting with text editors. I think that doesn't overwhelm someone who is learning with the IDE features. That said, `IDLE `__ is a good in-between choice for beginners and one that I personally use in the book and definitely would be my first choice.
+
+**Q: What library do we use for importing metric units that works well with sympy?**
+
+I would recommend taking a look at SymPy's `Units `__ module and see if it has what you need. In addition, and if you already don't know about it, `pint `__ would be another library to look at.
+
+**Q: Do you use notebook for exploratory work?**
+
+Yes, I use notebook for exploratory work. I think notebooks are great when you want the code and result together in a single document. It's great for sharing too. I recently created `slides `__ as a Notebook.
+
+**Q: Can Sympy be used for the development in a engineering software (i.e. Finite Element Method)? Would the computational speed be (good)? (Not sure about the second part of the question)**
+
+You may be interested in taking a look at `SfePy `__
+
+**Q: Thoughts on Cython? Sagemath?**
+
+I haven't worked much with Cython. I know about it and what it can useful for. So, I guess if you are looking for speed, definitely look into it. I would also recommend looking at `Numba `__. Sagemath is more of a system itself than a library. It integrates popular Python libraries and would definitely be something to explore.
+
+**Q: Should students use IDLE or a notebook format?**
+
+I would recommend using IDLE to start with. It gives the opportunity for the student to at least get an idea of the cycle of editing code and running it. I would only introduce notebook later and in addition to IDLE. Both have their merits, but Notebook just introduces one more thing to grasp in the beginning.
+
+**Q: Any recommendations for introducing 3D graphics e.g. polyhedrons on screen?**
+
+I haven't explored them, you may want to look at `Pi3D `__ or `VPython `__.
+
+**Q: How well do SymPy and Numpy work together?**
+
+No personal experience, but searching a bit, it looks like you may want to look at SymPy's `Lambdify `__ feature. The `SymPy google group `__ may give you a better answer.
+
+
+**Q: You are working in Jupyter - can the "app"s you should be embedded in a regular HTML web page?**
+
+I haven't personally tried this. I think this `post `__ may give you clues to do it. O'Reilly Media's project `thebe `__ may be another option to look at.
+
+
+**Announcement post**
+
+I am very excited to share that I am doing a webcast this coming week with O'Reilly titled
+"Doing Math with Python". You can register for it on the `event page `__.
+
+Here are the date and time of the webcast:
+
+- Wed, June 29th at 7 PM, San Francisco
+- Wed, June 29th at 10pm, New York
+- Thu, Jun 30th at 3am - London
+- Thu, Jun 30th at 7:30am - Mumbai
+- Thu, Jun 30th at 10am - Beijing
+- Thu, Jun 30th at 11am - Tokyo
+- Thu, Jun 30th at 12pm - Sydney
+
+I have created a `GitHub repository `__ which
+will have the rough transcript, final slides and the code examples as Jupyter Notebooks.
diff --git a/content/pages/about.rst b/content/pages/about.rst
new file mode 100644
index 0000000..6d44a70
--- /dev/null
+++ b/content/pages/about.rst
@@ -0,0 +1,124 @@
+:Title: About
+:pageno: 1
+
+`Doing Math with Python` is written by `Amit Saha
+`__ and published by `No
+Starch Press `__.
+It has been translated to French, Simplified Chinese, Korean and Japanese.
+
+The English version of the book is now available in print and electronic formats (including
+Amazon Kindle). Please refer to the `Buy <{filename}buy.rst>`__
+page. Some readers have taken the time out to post a review of the
+book on Amazon and elsewhere. Please refer to the `Reviews
+<{filename}reviews.rst>`__ page.
+
+.. image:: {filename}/images/cover.png
+ :align: center
+ :target: http://www.nostarch.com/doingmathwithpython
+ :alt: Book cover
+
+There are seven chapters and 2 Appendices in the book. A detailed
+table of contents is available from the `publisher's website
+`__.
+
+
+Chapter 1: Numbers
+~~~~~~~~~~~~~~~~~~
+
+This chapter starts with the absolute basics of handling numbers in
+Python. It discusses integers, floating point numbers, fractions,
+complex numbers and performing operations with them.
+
+Chapter 2: Visualizing Data with Graphs
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+This chapter introduces Matplotlib and shows how to create graphs
+representing collections of numbers.
+
+Chapter 3: Describing Data with Statistics
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+As the title suggests, this chapter is all about the statistical
+measures one would first learn in high school – mean, median, mode,
+frequency table, range, variance, standard deviation and linear
+correlation are discussed.
+
+Chapter 4: Algebra and Symbolic Math with SymPy
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+The first three chapters are all about number crunching. The fourth
+chapter introduces the reader to the basics of manipulating symbolic
+expressions using SymPy. Factorizing algebraic expressions, solving
+equations, plotting from symbolic expressions are some of the topics
+discussed in this chapter.
+
+Chapter 5: Sets and Probability
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+This chapter starts off with how to create a set and demonstrating the
+common set operations. Utility of the different set operations are
+demonstrated via simple applications. For example, Cartesian product
+is used to write a program to simulate an experiment to calculate the
+time period of a simple pendulum of different lengths and at places
+with varying gravity. Union and intersection operations are applied to
+finding the probability of events.
+
+The chapter then moves onto discussing how to generate uniform and non
+uniform random numbers, and using them to simulate scenarios such as a
+die roll and a fictional ATM which dispenses dollar bills of different
+denominations with varying probability.
+
+Chapter 6: Drawing shapes and Fractals
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+This chapter is logically divided into two parts. The first part
+introduces the reader to matplotlib patches which allows drawing
+geometric shapes (circles and polygons), followed by matplotlib’s
+animation API which allows drawing animated figures. The trajectory of
+a projectile motion discussed elsewhere in various contexts is
+animated combining both these things.
+
+The second part of the chapter introduces the concept of geometric
+transformation. Combining that with the knowledge of generating random
+numbers learned earlier in Chapter 5, the reader will learn how to
+draw fractals such as the Barnsley Fern, Sierpinski triangle and
+Mandelbrot set.
+
+Chapter 7: Solving Calculus Problems
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+This chapter discusses solving differentiation and integration tasks
+using programs. As applications, the gradient ascent (and descent)
+methods and continuous probability are discussed.
+
+Appendix A
+~~~~~~~~~~
+
+This appendix covers the installation of software required to run the
+programs in the book on Microsoft Windows, Linux and Mac OS X.
+
+Appendix B
+~~~~~~~~~~
+
+This appendix discusses some Python topics which the reader may not be
+familiar with, but are needed to follow some parts of the book. It
+also includes topics which provide additional information beyond that
+required for the programs in the book.
+
+
+Stay in touch
+=============
+
+You can stay connected with the book, its readers and me via the
+following channels:
+
+- `Facebook page `__
+- `G+ Community `__
+- `Twitter `__
+
+You can contact me directly via:
+
+- Twitter: `@mathwithpython `__
+- Email : doingmathwithpython@gmail.com
+
+`Page last updated: August 29, 2015`
diff --git a/content/pages/buy.rst b/content/pages/buy.rst
new file mode 100644
index 0000000..0d8d16c
--- /dev/null
+++ b/content/pages/buy.rst
@@ -0,0 +1,35 @@
+:Title: Buy
+:pageno: 6
+
+You can buy the book via the publisher's website, Amazon, OReilly:
+
+- `No Starch Press `__
+- `Amazon `__
+- `OReilly `__
+
+Some other country specific links that I found upon searching:
+
+Australia
+=========
+
+- `Book Depository `__
+- `Readings.com.au `__
+
+India
+=====
+- `Amazon India
+ `__
+
+Germany
+=======
+
+- `Amazon Germany
+ `__
+
+U.K.
+====
+
+- `Book Depository `__
+- `Amazon UK
+ `__
+
diff --git a/content/pages/chapter_programs.rst b/content/pages/chapter_programs.rst
new file mode 100644
index 0000000..d916355
--- /dev/null
+++ b/content/pages/chapter_programs.rst
@@ -0,0 +1,32 @@
+:Title: Programs
+:pageno: 3
+
+
+
+ In the following pages, you can find the important code snippets and
+ programs discussed in the different chapters:
+
+- `Chapter 1 `__
+- `Chapter 2 `__
+- `Chapter 3 `__
+- `Chapter 4 `__
+- `Chapter 5 `__
+- `Chapter 6 `__
+- `Chapter 7 `__
+
+
+Solutions to Challenges
+=======================
+
+See the `blog post `__
+for instructions to download the solutions including the explanations.
+
+Alternatively, you can view the code for the solutions here:
+
+- `Chapter 1 `__
+- `Chapter 2 `__
+- `Chapter 3 `__
+- `Chapter 4 `__
+- `Chapter 5 `__
+- `Chapter 6 `__
+- `Chapter 7 `__
diff --git a/content/pages/errata.rst b/content/pages/errata.rst
new file mode 100644
index 0000000..b11f3ce
--- /dev/null
+++ b/content/pages/errata.rst
@@ -0,0 +1,163 @@
+:Title: Errata
+:date: 2015-04-04
+:pageno: 4
+
+Chapter 2
+=========
+
+On Page 47, in the second last sentence of the second last paragraph, the book currently states "The x-axis of the
+graph displays the force, and the y-axis displays the distance.". It should be "The x-axis of the graph displays the distance
+and the y-axis displays force".
+
+(Thanks to Mike Beasley for pointing this out)
+
+On Page 48, Figure 2-12 caption should be "Figure 2-12: Visualization of the relationship between the gravitational force and
+the distance" and not "..squared distance".
+
+On Page 52, in the paragraph starting with "In this program...", the book currently states,
+".. we calculate the time of flight and then call the frange() function with the values for start, final, and
+increment set to 0,". "increment" should be "interval".
+
+(Thanks to a lovely Japanese reader for pointing this out).
+
+Chapter 3
+=========
+
+On Page 77, in the program for finding the correlation coefficient, the last `for` loop has an extra space infront of
+it. It should be:
+
+.. code::
+
+ ..
+ y_square = []
+ for yi in y:
+ y_square.append(yi**2)
+ ...
+
+
+(Thanks to Elmar Bucher for pointing this out)
+
+On Page 87, the book refers to the Google Correlate service. However, as of December 2019,
+the service has been shutdown. Since the chapter requires you to download a CSV formatted data,
+it is no longer possible. However, you can instead download a version of the data that I had
+used 5 years back when writing the book from `here `__.
+
+(Thanks to Tuomo Kalliokoski)
+
+Chapter 4
+=========
+
+On page 97, in the section "Factorizing and Expanding Expressions", the
+expand function should be imported before we can use it via
+``from sympy import expand``.
+
+On page 99, in the code snippet on Line (2) and the following, the indentation is wrong.
+It should be:
+
+.. code::
+
+ for i in range(2, n+1):
+ series = series + (x**i)/i
+
+(Thanks to Taylan Yemliha)
+
+On page 112, an import is missing - `SympifyError` used later in the
+`try..except` block. The initial import statement should hence be:
+
+.. code::
+
+ from sympy import Symbol, sympify, solve, SympifyError
+
+(Thanks to Robert Buckley for pointing it out)
+
+On page 115, in the first paragram, "using the first letter of the color.." is not correct for black, since we use `k`
+for `black` color.
+
+(Thanks to Elmar Bucher for pointing this out)
+
+Chapter 5
+=========
+
+On page 132, in the section "Probability", the program should start
+with the import statment ``from sympy import FiniteSet``. (Thanks to
+Dexter Edge)
+
+On page 132, in the section "Probability," the code line above the one
+marked with a (3), which reads ``for num in s:`` should instead read:
+``for num in space``.
+
+On page 135, in "Can You Roll That Score?" there is no need for `import matplotlib.pyplot as plt`.
+
+(Thanks to Elmar Bucher for the above)
+
+On page 139, in the code for simulating a fictional ATM, the statement
+``probability = [1/6, 1/6, 1/3, 2/3]`` should be ``probability = [1/6,
+1/6, 1/3, 1/3]``. (Thanks to Luis Soares)
+
+
+Chapter 6
+=========
+
+On page 164 and 165, the transformation equations have some errors in the text
+(not in the program). The equations should be:
+
+**Transformation 1**
+
+x1 = 0.85*x + 0.04*y
+
+y1 = -0.04*x + 0.85*y + 1.6
+
+
+**Transformation 2**
+
+x1 = 0.2*x - 0.26*y
+
+y1 = 0.23*x + 0.22*y + 1.6
+
+**Transformation 3**
+
+x1 = -0.15*x + 0.28*y
+
+y1 = 0.26*x + 0.24*y + 0.44
+
+
+**Transformation 4**
+
+x1 = 0
+
+y1 = 0.16*y
+
+(Thanks to Dexter Edge, Fatih Kürşat Cansu, Toshiaki Kurokawa and Twitter @mkamimura)
+
+Chapter 7
+=========
+
+On page 195, an import is missing - `SympifyError` used later in the
+`try..except` block. The initial import statement should hence be:
+
+.. code::
+
+ from sympy import Derivative, Symbol, sympify, SympifyError
+
+(Thanks to Robert Buckley for pointing it out)
+
+On page 204, in the first paragraph, the first property should be "..the function value for x is always greater then or equal 0".
+
+(Thanks to Elmar Bucher for pointing this out)
+
+Appendix B
+==========
+
+
+On page 226, in "Multiple Return Values", the code snippet to call the `components()`
+functions should be:
+
+.. code::
+
+ if __name__ == '__main__':
+ u = 5
+ theta = math.radians(45)
+ x, y = components(u, theta)
+
+(Thanks to a reader for pointing it out)
+
diff --git a/content/pages/install.rst b/content/pages/install.rst
new file mode 100644
index 0000000..f04163a
--- /dev/null
+++ b/content/pages/install.rst
@@ -0,0 +1,35 @@
+:Title: Software Installation
+:date: 2015-04-04 08:06
+:pageno: 2
+
+The programs in the book and the proposed solutions are tested to run
+on ``Python 3.5``, ``matplotlib 1.4.2``, ``matplotlib-venn 0.11`` and ``sympy
+0.7.6``. The version numbers stated are the minimum requirements and the
+programs should also work with higher versions of the
+software. However, if there is any change, it will be noted
+accordingly here.
+
+There are various ways of installing these required software but one
+of the easiest is to use the `Anaconda
+`__ Python 3 software distribution
+available freely for Microsoft Windows, Linux and Mac OS X.
+
+- `Windows <{filename}install/windows.rst>`__
+- `Linux <{filename}install/linux.rst>`__
+- `Mac OS X Yosemite <{filename}install/macosx.rst>`__
+
+Updating your existing installation
+===================================
+
+Once you have installed Anaconda, over time you can keep it updated to the latest version using the following commands from your terminal::
+
+ $ conda update conda
+ $ conda update anaconda
+
+Related blog posts
+==================
+
+- `Anaconda 5.0 release `__
+- `SymPy 1.0 and Anaconda 4.0 releases `__
+
+`Page last updated: April 11, 2016`
diff --git a/content/pages/install/linux.rst b/content/pages/install/linux.rst
new file mode 100644
index 0000000..6d6d691
--- /dev/null
+++ b/content/pages/install/linux.rst
@@ -0,0 +1,76 @@
+:Title: Software Installation on Linux
+:status: hidden
+
+`Download `__ the Anaconda Python 3.4 installer
+and start the installation by executing ``bash ``:
+
+::
+
+ Welcome to Anaconda3 2.1.0 (by Continuum Analytics, Inc.)
+
+ In order to continue the installation process, please review the license
+ agreement.
+ Please, press ENTER to continue
+ >>> ENTER
+
+ The “Anaconda END USER LICENSE AGREEMENT” will be displayed. Once you have read through it, type in “yes” to continue the installation:
+ Do you approve the license terms? [yes|no]
+ [no] >>> yes
+
+ Anaconda3 will now be installed into this location:
+ /home/testuser/anaconda3
+
+ - Press ENTER to confirm the location
+ - Press CTRL-C to abort the installation
+ - Or specify an different location below
+
+If you press ENTER above, the installation will start:
+
+::
+
+ [/home/testuser/anaconda3] >>>
+ PREFIX=/home/testuser/anaconda3
+ installing: python-3.4.1-4 ...
+ installing: conda-3.7.0-py34_0
+ ..
+
+ creating default environment...
+ installation finished.
+ Do you wish the installer to prepend the Anaconda3 install location
+ to PATH in your /home/testuser/.bashrc ? [yes|no]
+
+We will type in “yes”:
+
+::
+
+ [no] >>> yes
+
+ Prepending PATH=/home/testuser/anaconda3/bin to PATH in /home/testuser/.bashrc
+ A backup will be made to: /home/testuser/.bashrc-anaconda3.bak
+
+
+ For this change to become active, you have to open a new terminal.
+
+ Thank you for installing Anaconda3!
+
+Open a new terminal for the next steps.
+
+Updating sympy
+~~~~~~~~~~~~~~
+
+We will first install/update ``sympy`` to make sure we have ``sympy-0.7.6`` installed::
+
+ $ conda install sympy=0.7.6
+
+Installing matplotlib-venn
+~~~~~~~~~~~~~~~~~~~~~~~~~~
+Use the following command to install matplotlib-venn::
+
+ $ pip install matplotlib-venn
+
+Starting Python shell
+~~~~~~~~~~~~~~~~~~~~~
+
+Open a new terminal and type in ``idle3`` to start the IDLE editor or
+``python`` to start the Python 3.4 shell. You should now be able to run
+all the programs and try out new ones.
diff --git a/content/pages/install/macosx.rst b/content/pages/install/macosx.rst
new file mode 100644
index 0000000..365aead
--- /dev/null
+++ b/content/pages/install/macosx.rst
@@ -0,0 +1,66 @@
+:Title: Software Installation on Mac OS X Yosemite
+:status: hidden
+
+`Download `__ the Anaconda GUI
+installer for Python 3. Start the installation by double clicking on
+the .pkg file:
+
+.. figure:: {filename}/images/install/mac1.png
+ :scale: 50 %
+ :alt: mac1
+
+Click Next on the next two screens and accept the License Agreement:
+
+.. figure:: {filename}/images/install/mac4.png
+ :scale: 50 %
+ :alt: mac2
+
+You can choose to install the distribution either for your user only
+or for all users using this computer. We will go with the former:
+
+.. figure:: {filename}/images/install/mac5.png
+ :scale: 50 %
+ :alt: mac5
+
+The error message is a bug in the installer software. Just click it, and
+it will disappear. Click Continue to proceed.
+
+.. figure:: {filename}/images/install/mac7.png
+ :scale: 50 %
+ :alt: mac7
+
+Click "Install" to start the installation.
+
+
+.. figure:: {filename}/images/install/mac9.png
+ :scale: 50 %
+ :alt: mac7
+
+Click on "Close" to complete the installation.
+
+Open the Terminal app and carry out the following steps.
+
+Installing sympy
+~~~~~~~~~~~~~~~~
+
+The installation may come with ``sympy`` already installed, but we want to
+make sure that we have at least ``0.7.6``, so we will install it using the
+command ``conda install sympy=0.7.6``. This should update (if already
+installed) or install sympy to the 0.7.6 version.
+
+Installing matplotlib-venn
+~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+To install ``matplotlib-venn``, use the command ``pip install matplotlib-venn``.
+
+Your computer is now setup to run all the programs.
+
+Starting Python shell
+~~~~~~~~~~~~~~~~~~~~~
+
+Open a Terminal and type ``idle3`` to start the IDLE shell or
+python to start the Python 3 default shell.
+
+.. figure:: {filename}/images/install/mac10.png
+ :scale: 30 %
+ :alt: mac10
diff --git a/content/pages/install/windows.rst b/content/pages/install/windows.rst
new file mode 100644
index 0000000..4bd6e05
--- /dev/null
+++ b/content/pages/install/windows.rst
@@ -0,0 +1,80 @@
+:Title: Software Installation on Windows 7
+:status: hidden
+
+`Download `__ the Anaconda GUI
+installer for Python 3. Start the installation by double clicking on
+the installer.
+
+.. figure:: {filename}/images/install/windows1.png
+ :scale: 50 %
+ :alt: windows1
+
+Click Next and accept the License Agreement on the next screen:
+
+.. figure:: {filename}/images/install/windows2.png
+ :scale: 50 %
+ :alt: windows2
+
+You can choose to install the distribution either for your user only
+or for all users using this computer. We will go with the former:
+
+.. figure:: {filename}/images/install/windows3.png
+ :scale: 50 %
+ :alt: windows3
+
+Next, choose the folder where you want Anaconda to install the programs:
+
+.. figure:: {filename}/images/install/windows4.png
+ :scale: 50 %
+ :alt: windows4
+
+Check the next two boxes so that you can invoke the Python shell and
+other programs from anywhere on the command prompt and any other
+programs will use the Python installed by Anaconda as the default:
+
+.. figure:: {filename}/images/install/windows5.png
+ :scale: 50 %
+ :alt: windows5
+
+Click on “Install” to start the installation:
+
+.. figure:: {filename}/images/install/windows6.png
+ :scale: 50 %
+ :alt: windows6
+
+.. figure:: {filename}/images/install/windows7.png
+ :scale: 50 %
+ :alt: windows7
+
+.. figure:: {filename}/images/install/windows8.png
+ :scale: 50 %
+ :alt: windows8
+
+Click on “Finish” to complete the installation.
+
+Open a Windows command prompt and carry out the following steps.
+
+Installing sympy
+~~~~~~~~~~~~~~~~
+
+The installation may come with ``sympy`` already installed, but we want to
+make sure that we have at least ``0.7.6``, so we will install it using the
+command ``conda install sympy=0.7.6``. This should update (if already
+installed) or install sympy to the 0.7.6 version.
+
+Installing matplotlib-venn
+~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+To install ``matplotlib-venn``, use the command ``pip install matplotlib-venn``.
+
+Your computer is now setup to run all the programs.
+
+Starting Python shell
+~~~~~~~~~~~~~~~~~~~~~
+
+Open a windows command prompt and type ``idle`` to start the IDLE shell or
+python to start the Python 3 default shell.
+
+.. figure:: {filename}/images/install/windows9.png
+ :scale: 30 %
+ :alt: windows4
diff --git a/content/pages/resources.rst b/content/pages/resources.rst
new file mode 100644
index 0000000..fe74107
--- /dev/null
+++ b/content/pages/resources.rst
@@ -0,0 +1,37 @@
+:Title: Help
+:pageno: 5
+
+If you have any specific issue while following the book, please get in
+touch via email at doingmathwithpython@gmail.com, or you can post a
+query on the `Google plus page
+`__ or
+`Facebook page `__.
+
+
+Chapter specific Resources
+==========================
+
+- `Chapter 1 <{filename}resources/chap1.rst>`__
+- `Chapter 2 <{filename}resources/chap2.rst>`__
+- `Chapter 3 <{filename}resources/chap3.rst>`__
+- `Chapter 4 <{filename}resources/chap4.rst>`__
+- `Chapter 5 <{filename}resources/chap5.rst>`__
+- `Chapter 6 <{filename}resources/chap6.rst>`__
+- `Chapter 7 <{filename}resources/chap7.rst>`__
+
+Generic resources
+=================
+
+- `Scipy Lecture Notes `__
+
+Mailing lists
+=============
+
+- `python-tutor `__
+- `SymPy mailing list `__
+- `matplotlib `__
+
+Other forums
+============
+
+- `StackOverflow `__
diff --git a/content/pages/resources/chap1.rst b/content/pages/resources/chap1.rst
new file mode 100644
index 0000000..9cee3ed
--- /dev/null
+++ b/content/pages/resources/chap1.rst
@@ -0,0 +1,27 @@
+:Title: Chapter 1: Numbers
+:status: hidden
+
+Standard library Resources
+==========================
+
+*Modules*
+
+* `math `__
+* `cmath `__
+* `decimal `__
+* `fractions `__
+
+*Classes*
+
+* `Counter `__
+
+Third party packages
+====================
+
+* `units `__
+* `pint `__
+
+Articles
+========
+
+* `Floating Point Arithmetic: Issues and Limitations `__
diff --git a/content/pages/resources/chap2.rst b/content/pages/resources/chap2.rst
new file mode 100644
index 0000000..6a84991
--- /dev/null
+++ b/content/pages/resources/chap2.rst
@@ -0,0 +1,14 @@
+:Title: Chapter 2: Visualizing Data with Graphs
+:status: hidden
+
+Matplotlib reference
+====================
+
+* `plot() `__
+* `bar() `__
+* `savefig() `__
+
+Articles
+========
+
+* `The life and numbers of Fibonacci `__
diff --git a/content/pages/resources/chap3.rst b/content/pages/resources/chap3.rst
new file mode 100644
index 0000000..7c8d965
--- /dev/null
+++ b/content/pages/resources/chap3.rst
@@ -0,0 +1,14 @@
+:Title: Chapter 3: Describing Data with Statistics
+:status: hidden
+
+Standard library Resources
+==========================
+
+* `statistics `__
+* `csv `__
+
+Articles
+========
+
+* `Calculating Percentiles `__
+
diff --git a/content/pages/resources/chap4.rst b/content/pages/resources/chap4.rst
new file mode 100644
index 0000000..00c61a5
--- /dev/null
+++ b/content/pages/resources/chap4.rst
@@ -0,0 +1,12 @@
+:Title: Chapter 4: Algebra and Symbolic Math with SymPy
+:status: hidden
+
+SymPy documentation
+===================
+
+* `SymPy Tutorial `__
+* `Inequality Solvers `__
+
+
+Articles
+========
diff --git a/content/pages/resources/chap5.rst b/content/pages/resources/chap5.rst
new file mode 100644
index 0000000..b5a8c34
--- /dev/null
+++ b/content/pages/resources/chap5.rst
@@ -0,0 +1,13 @@
+:Title: Chapter 5: Sets and Probability
+:status: hidden
+
+Standard library Resources
+==========================
+
+* `random `__
+
+Articles
+========
+
+* `Set operations with Python set compared to SymPy's FiniteSet `__
+* `Probability, Padadox and the Reasonable Person Principle `__
diff --git a/content/pages/resources/chap6.rst b/content/pages/resources/chap6.rst
new file mode 100644
index 0000000..3e9875e
--- /dev/null
+++ b/content/pages/resources/chap6.rst
@@ -0,0 +1,17 @@
+:Title: Chapter 6: Drawing Geometric Shapes and Fractals
+:status: hidden
+
+Matplotlib documentation
+========================
+
+* `Matplotlib patches API `__
+* `Image tutorial `__
+
+Articles
+========
+
+* `Matplotlib Animation Tutorial `__
+* `Drawing and Animating Shapes with Matplotlib `__
+* `Defining the Mandelbrot Set `__
+* `Circle packing in a square `__
+* `Fractal trees `__
diff --git a/content/pages/resources/chap7.rst b/content/pages/resources/chap7.rst
new file mode 100644
index 0000000..8d82f6c
--- /dev/null
+++ b/content/pages/resources/chap7.rst
@@ -0,0 +1,9 @@
+:Title: Chapter 7: Solving Calculus Problems
+:status: hidden
+
+Articles
+========
+
+* `Finding Absolute Extrema `__
+* `An Introduction to Gradient Descent and Linear Regression `__
+* `The idea of a probability density function `__
diff --git a/content/pages/reviews.rst b/content/pages/reviews.rst
new file mode 100644
index 0000000..2889084
--- /dev/null
+++ b/content/pages/reviews.rst
@@ -0,0 +1,27 @@
+:Title: Reviews
+:pageno: 7
+
+Amazon
+======
+
+- `All Amazon.com reviews
+ `__
+- `All Amazon.co.uk reviews `__
+- `All Amazon.de reviews `__
+
+No Starch Press
+===============
+
+- `Reviews on No Starch Press book page `__
+
+Blog posts/elsewhere
+====================
+
+- `Goodreads `__
+- `Jason Moore's review `__
+- `Aaron Meurer's review `__
+- `Full circle magazine review `__
+- `Review by i-programmer `__
+- `Review by Gin Brookes Foundation `__
+- `Inside Big Data `__
+- `Game vortex review `__
diff --git a/content/pycon-au-2016-education-summit.rst b/content/pycon-au-2016-education-summit.rst
new file mode 100644
index 0000000..ffd3165
--- /dev/null
+++ b/content/pycon-au-2016-education-summit.rst
@@ -0,0 +1,61 @@
+PyCon Australia 2016 Education Seminar
+======================================
+
+:date: 2016-08-12 11:27
+:category: updates
+:slug: pycon-au-edu-summit-talk
+:summary: PyCon AU education summit talk
+
+I attended the PyCon Australia 2016 Education seminar held on 12th August at Melbourne, Australia.
+I loved the energy of the seminar and was great to hear about all the ways educators in Australia are
+using Python for their teaching. Here are some notes I took, which I also link with the videos. You can
+find all the videos `here `__.
+
+Python at Monash
+----------------
+
+- Faculty of IT
+- Python close to pseudocode
+- Jupyter Notebooks
+- Jupyter Hub installation at Monash
+
+Keynote: Smart City - From earth to mars and back
+-------------------------------------------------
+
+- `Video `__
+- Find a social mission
+
+
+Teaching Python
+---------------
+
+- `Video `__
+- Teaching isn't easy
+- Programming isn't easy, it's new
+- Grok learning, interactivepython.org, coursera, codecadaemy..
+- Emphasise the fundamentals, don't assume anything, be explicit
+
+
+Python with Minecraft
+---------------------
+
+- `Video `__
+- Get kids excited
+- Consumers to creators
+
+MicroPython
+-----------
+
+- `Video `__
+- Groklearning Microbit
+- https://groklearning.com/competition/codequest-microbit-2016/
+
+
+Teaching Geometry using Logo/Python turtle module
+-------------------------------------------------
+
+- `Video `__
+- Don't teach subjects in silos
+- Show students you can do real useful stuff with programming
+- Turtle powered Geometry
+- Grok learning lessons (turtle in your browser)
diff --git a/content/pycon-us-2016-education-summit.rst b/content/pycon-us-2016-education-summit.rst
new file mode 100644
index 0000000..88a6b6e
--- /dev/null
+++ b/content/pycon-us-2016-education-summit.rst
@@ -0,0 +1,14 @@
+PyCon Education Summit Talk
+===========================
+
+:date: 2016-05-26 11:27
+:category: updates
+:slug: pycon-edu-summit-talk
+:summary: PyCon education summit talk
+
+
+Hi everyone, I have uploaded the `slides `__ for my upcoming talk at the PyCon Education Summit. If you are coming to the talk, feel free to have a look at the slides and have any questions/comments ready for me.
+
+The slides are made using Jupyter Notebook + nbconvert magic. Thank you to everyone who makes these things happen. You can see the slides notebook `here `__.
+
+As a PyCon special, No Starch Press has setup a discount code ``PYCONMATH`` code which will give you 30 % off my book, `Doing Math with Python `__ and is valid from May 26th - June 8th.
diff --git a/content/pyconau-education-seminar-talk.rst b/content/pyconau-education-seminar-talk.rst
new file mode 100644
index 0000000..39c057c
--- /dev/null
+++ b/content/pyconau-education-seminar-talk.rst
@@ -0,0 +1,17 @@
+PyCon Australia 2016 Education Seminar: Doing Math with Python
+==============================================================
+
+:date: 2016-08-06 18:00
+:category: updates
+:slug: pyconau-dmwp
+:summary: PyConAU2016
+
+
+Hello everyone, I will be `speaking `__ at the PyCon AU education seminar coming August 12, 2016 at Melbourne, Australia (3.00 - 3.40 PM).
+
+I have put up my in progress slides (PDF) and the demos as Jupyter Notebooks (Python 3), I plan to use during the talk on `GitHub `__. If you are coming along, please let me know if there is anything specific I can share and discuss.
+
+**Links**
+
+- `Talk abstract `__
+- `Slides and Demos `__
diff --git a/content/python-humble-bundle.rst b/content/python-humble-bundle.rst
new file mode 100644
index 0000000..9712341
--- /dev/null
+++ b/content/python-humble-bundle.rst
@@ -0,0 +1,20 @@
+Doing Math with Python in Python Humble Bundle
+==============================================
+:date: 2019-08-23
+:category: updates
+:slug: humble-bundle-python
+:summary: Humble bundle Python
+
+"Doing Math with Python" is part of No Starch Press's `Python Humble Bundle `__.
+Of course, you get No Starch Press's other excellent Python books as part of the bundle. It's still on for the next 10 days!
+
+
+.. figure:: {filename}/images/python-humble-bundle.png
+ :align: left
+ :alt: Humble Bundle
+ :scale: 10%
+
+Your purchases will help support the No Starch Foundation and Python Software Foundation.
+
+
+Get the bundle `here `__.
diff --git a/content/sets-sympy-python.rst b/content/sets-sympy-python.rst
new file mode 100644
index 0000000..9de68c8
--- /dev/null
+++ b/content/sets-sympy-python.rst
@@ -0,0 +1,280 @@
+Set operations with Python ``set`` compared to SymPy's FiniteSet
+================================================================
+:date: 2015-09-05 23:00
+:category: articles
+:slug: Sets-in-SymPy-and-built-in-Python-sets
+:summary: Sets in SymPy and built-in Python sets
+
+
+`Chapter 5` (`About <{filename}pages/about.rst>`__) of the book discusses working with mathematical sets in
+Python. While writing the chapter, I had a choice of whether to
+use Python 3's built-in `set
+`__ data
+structure or use SymPy's (0.7.6 +) ``FiniteSet`` class. I decided to go ahead
+with the latter. My choice is briefly explained towards the end of
+this post, but hopefully it will be clear before that.
+
+Next, I describe how you can use Python 3's built-in set data
+structure to create sets and perform set operations such as finding
+the union, intersection or cartesian product of sets. For comparison,
+I also show how you can do the same using SymPy's ``FiniteSet`` class.
+
+
+Creating a set
+~~~~~~~~~~~~~~
+
+We can create a set consisting of the elements `{1, 2, 3}` in Python 3
+as follows:
+
+.. code-block:: python
+
+ >>> s1 = {1, 2, 3}
+ >>> s1
+ {1, 2, 3}
+
+To create a set when the elements are already in a list (for
+example), we would use the following syntax:
+
+.. code-block:: python
+
+ >>> items = [1, 2, 3]
+ >>> s2 = set(items)
+ >>> s2
+ {1, 2, 3}
+
+The comparative operations using SymPy's ``FiniteSet`` class are:
+
+.. code-block:: python
+
+ >>> from sympy import FiniteSet
+ >>> s1 = FiniteSet(1, 2, 3)
+ >>> s1
+ {1, 2, 3}
+
+ >>> items = [1, 2, 3]
+ >>> s2 = FiniteSet(*items)
+ >>> s2
+ {1, 2, 3}
+
+To create an `empty set `__,
+in Python 3 you would use create an empty ``set`` object:
+
+.. code-block:: python
+
+ >>> e = set()
+ >>> e
+ set()
+
+In SymPy, an empty set is represented by an ``EmptySet`` object. Thus,
+you can either create an empty set by directly creating an
+``EmptySet`` object or by creating a ``FiniteSet`` object without
+specifying any set members, like so:
+
+.. code-block:: python
+
+ >>> from sympy import EmptySet
+ >>> e = EmptySet()
+ >>> e
+ EmptySet()
+ >>> e = FiniteSet()
+ >>> e
+ EmptySet()
+
+
+Cardinality and Membership
+~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+The ``len()`` function returns the number of set members for sets
+created using either of the above approaches.
+
+Similarly, to check if an item ``x`` is present in a set, ``s``
+created using any of the above approaches, we can use the statement,
+``x in s``.
+
+Union and intersection
+~~~~~~~~~~~~~~~~~~~~~~
+
+The ``union()`` method can be used in both cases to find the union of
+two or more sets:
+
+.. code-block:: python
+
+ >>> s1 = set([1, 2, 3])
+ >>> s2 = set([2, 3, 4])
+ >>> s3 = set([2, 3, 4, 5])
+ >>> s1.union(s2).union(s3)
+ {1, 2, 3, 4, 5}
+
+Similary in the case of SymPy:
+
+.. code-block:: python
+
+ >>> from sympy import FiniteSet
+ >>> s1 = FiniteSet(1, 2, 3)
+ >>> s2 = FiniteSet(2, 3, 4)
+ >>> s3 = FiniteSet(2, 3, 4, 5)
+ >>> s1.union(s2).union(s3)
+ {1, 2, 3, 4, 5}
+
+
+The ``intersection()`` method can be used to find the intersection of
+two or more sets created using either of the above approaches. Continuing
+with the above three sets:
+
+.. code-block:: python
+
+ >>> s1 = set([1, 2, 3])
+ >>> s2 = set([2, 3, 4])
+ >>> s3 = set([2, 3, 4, 5])
+ >>> s1.intersection(s2).intersection(s3)
+ {2, 3}
+
+Similary, in SymPy:
+
+.. code-block:: python
+
+ >>> s1.intersection(s2).intersection(s3)
+ {2, 3}
+
+
+Cartesian product
+~~~~~~~~~~~~~~~~~
+
+To find the cartesian product of sets created via the built-in ``set``
+data structure, we have to use the ``product()`` function in the
+`itertools
+`__
+module:
+
+.. code-block:: python
+
+ >>> s1 = {1, 2, 3}
+ >>> s2 = {4, 5, 6}
+ >>> import itertools
+ >>> itertools.product(s1, s2)
+
+
+However considering that the `cartesian product` of two sets `should
+`__ be another set,
+the ``product()`` function doesn't really then return the
+cartesian product itself, but (an iterator to) the elements in it. Hence, if we
+try to apply the result returned by the function directly to a method or
+function which is expected to be applicable to a set, it will fail. For
+example, ``itertools.product(s1, s2).union(s3)`` will result in an error, but
+``set(itertools.product(s1, s2)).union(s3)`` will work.
+
+Using SymPy's ``FiniteSet``, you can use the ``*``
+(multiplication or product) operator to find the cartesian product
+and the result is a set itself. Thus, it is closer to what
+a cartesian product is mathematically. An example follows:
+
+.. code-block:: python
+
+ >>> s1 = FiniteSet(1, 2, 3)
+ >>> s2 = FiniteSet(4, 5, 6)
+ >>> >>> s3 = FiniteSet(7, 8, 9)
+ >>> (s1*s2).union(s3)
+ {7, 8, 9} U {1, 2, 3} x {4, 5, 6}
+
+**Cartesian product of a set with itself**
+
+
+To find the cartesian product of a set with itself, i.e. `s1*s1` for
+example, we pass in a keyword argument, ``repeat`` while calling the
+``itertools.product()`` function. The value of ``repeat`` is the
+`power` we want to raise the set to. Thus, ``itertools.product(s1,
+repeat=2)`` will calculate the cartesian product, `s1*s1`:
+
+.. code-block:: python
+
+ >>> s1 = {1, 2, 3}
+ >>> set(itertools.product(s1, repeat=2))
+ {(1, 2), (3, 2), (1, 3), (3, 3), (3, 1), (2, 1), (2, 3), (2, 2), (1, 1)}
+
+
+In SymPy, the ``**`` operator can be used for finding the cartesian
+product of a set with itself:
+
+.. code-block:: python
+
+ >>> s1 = FiniteSet(1, 2, 3)
+ >>> s1**2
+ {1, 2, 3} x {1, 2, 3}
+
+
+Subset/super set/proper subset checking
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+The ``issubset()`` and ``issuperset()`` methods are available for sets
+created via either approaches to check if a set is a subset and super
+set of another, respectively. Thus, ``s1.issubset(s2)`` will check if
+`s1` is a subset of `s2`.
+
+**Checking for proper subset and superset**
+
+To check if a set, `s1` is a `proper subset
+`__ of another set,
+`s2` when using built-in set, we can do the following:
+
+.. code-block:: python
+
+ >>> s1 = {1, 2, 3}
+ >>> s2 = {1, 2, 3, 4}
+ >>> s1.issubset(s2) and s1 != s2
+ True
+
+We can do something similar for `proper superset
+`__.
+
+In SymPy, we have ``is_proper_subset()`` and ``is_proper_superset()``
+methods which can be used to check if a set is a proper subset or
+superset of another, respectively. Thus, the above would be written as
+``s1.is_proper_subset(s2)``.
+
+
+Calculating the powerset
+~~~~~~~~~~~~~~~~~~~~~~~~
+
+For sets created via built-in ``set`` data structure, there is no
+direct method available to create the `power set
+`__. However, you can use the
+``powerset`` recipe described in the `itertools documentation
+`__.
+
+On the other hand, in SymPy, there is a ``powerset()`` method
+available which returns the power set:
+
+.. code-block:: python
+
+ >>> s1 = FiniteSet(1, 2, 3)
+ >>> s1.powerset()
+ {EmptySet(), {1}, {2}, {3}, {1, 2}, {1, 3}, {2, 3}, {1, 2, 3}}
+
+You can see that the ``powerset()`` method returns the power `set` and not the
+elements in it.
+
+Choice of SymPy's ``FiniteSet`` over ``set``
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+From the above comparison, we can see that SymPy's ``FiniteSet``
+provides us with nice features such as being able to use the ``*``
+operator to find the cartesian product, ``**`` operator to calculate
+the cartesian product with itself and ``powerset()`` method for calculating the
+power set. These are not present when using the built-in ``set`` data
+structure. This was certainly a big driving factor in my choice,
+since SymPy was also being used in other chapters of the book.
+
+However, a *key* reason for my choice was that I wanted to show how we
+can create sets which did not allow addition or removal once created -
+like mathematical sets. This need was fulfilled by SymPy's
+``FiniteSet`` since it used Python's ``frozenset`` data structure and
+not the ``set`` data sturcture.
+
+The alternative to that would have
+been to use ``frozenset`` directly, but I just did not like the idea
+of it and I would have also missed out on the nice features
+``FiniteSet`` would provide (eventually). I should note here that once
+I had made the decision to go with ``FiniteSet``, I `contributed
+`__ patches
+to SymPy to make the methods of ``FiniteSet`` more compatible with Python's built in set
+and also implement minor features I discussed above.
diff --git a/content/trailing-zeros-factorial-python.rst b/content/trailing-zeros-factorial-python.rst
new file mode 100644
index 0000000..eb10b11
--- /dev/null
+++ b/content/trailing-zeros-factorial-python.rst
@@ -0,0 +1,109 @@
+Number of trailing zeros in the factorial of an integer
+=======================================================
+
+:date: 2020-01-02 19:50
+:category: articles
+:slug: trailing-zeros-factorial
+:summary: Use Python to find the number of trailing zeros in the factorial of an integer
+
+I recently learned about a cool formula to calculate the number of
+trailing zeros in the factorial of a number. It has been a while since I
+wrote a program to do something like this. So, I decided to change that and
+write this blog post. Let's jump in.
+
+In the spirit of wring various "calculators" in the book, we will
+write a "number of trailing zero" calculator. First up though, let's refresh
+some key relevant concepts.
+
+**Factorial**: The factorial of a number, ``n`` denoted by ``n!`` is the product ``n*(n-1)*(n-2)...*1``.
+For example, ``5! = 5*4*3*2*1 = 120``.
+
+**Trailing zeros**: The trailing zeros of a number is the number of zeros at the end of a number. For example,
+the number 567100 has **two** trailing zeros.
+
+**Floor**: The floor of a number is the greatest integer less than or equal to x. That is floor of 3.2 is 3
+and that of 3.5 is 3 and the floor of 3 is 3 as well.
+
+
+Now, coming back to the focus of this post, this document at brilliant.org wiki
+explains the process in `detail `__.
+
+The key bit there in is this formula:
+
+.. figure:: {filename}/images/trailing_zeros_formula.png
+
+
+where, ``n`` is the number for whose factorial we want to find the number of trailing zeros.
+
+The following Python program implements the above formula:
+
+.. code::
+
+ import math
+
+
+ def is_positive_integer(x):
+ try:
+ x = float(x)
+ except ValueError:
+ return False
+ else:
+ if x.is_integer() and x > 0:
+ return True
+ else:
+ return False
+
+
+ def trailing_zeros(num):
+ if is_positive_integer(num):
+ # The above function call has done all the sanity checks for us
+ # so we can just convert this into an integer here
+ num = int(num)
+
+ k = math.floor(math.log(num, 5))
+ zeros = 0
+ for i in range(1, k + 1):
+ zeros = zeros + math.floor(num/math.pow(5, i))
+ return zeros
+ else:
+ print("Factorial of a non-positive non-integer is undefined")
+
+
+ if __name__ == "__main__":
+ fact_num = input(
+ "Enter the number whose factorial's trailing zeros you want to find: "
+ )
+ num_zeros = trailing_zeros(fact_num)
+ print("Number of trailing zeros: {0}".format(num_zeros))
+
+
+When we run this program using Python 3, it will ask for the number whose factorial's number of trailing
+zeros we want to find and then print it out, like so:
+
+.. code::
+
+ Enter the number whose factorial's trailing zeros you want to find: 5
+ Number of trailing zeros: 1
+
+If you enter a number which is not a positive integer, you will get an error message:
+
+.. code::
+
+ Enter the number whose factorial's trailing zeros you want to find: 5.1
+ Factorial of a non-positive integer is undefined
+ Number of trailing zeros: None
+
+
+
+Some key standard library functions we use in the above program are:
+
+- ``math.floor``: This function is used to find the floor of a number
+- ``math.log``: This function is used to find the logarithm of a number for a specified base (defaults to 10)
+- ``math.pow``: This function is used to find out the power of a number raised to another
+
+The above functions are defined in the `math module `__.
+
+Besides the above, we use the `is_integer()` function defined on a floating point object to check
+if the floating point object is actually an integer.
+
+The latest version of the code is available `here `__.
diff --git a/content/trying-out-the-solutionts.rst b/content/trying-out-the-solutionts.rst
new file mode 100644
index 0000000..456f6bc
--- /dev/null
+++ b/content/trying-out-the-solutionts.rst
@@ -0,0 +1,50 @@
+Trying out the solutions in IDLE
+================================
+:date: 2015-11-18 08:20
+:category: updates
+:slug: trying-out-solutions
+:summary: Trying out the solutions
+
+Once you `download
+`__ the solutions ZIP file, and extract it you will
+find the solutions for each chapter in the corresponding sub-directory.
+
+.. figure:: {filename}/images/zip-extracted.png
+ :align: center
+ :alt: Extracted ZIP archive
+
+The **PDF** file contains explanations for each of the solutions
+similar to the explanations for the programs in the book.
+
+Before you can try the programs out, you will have to open them first in IDLE.
+Let's consider the solution to a challenge posed in Chapter 6 to draw
+the Mandelbrot set - ``mandelbrot.py``. Start ``IDLE`` and click on the menu item ``File >
+Open`` and navigate to the location where you extracted the directory
+above and open the file ``mandelbrot.py``.
+
+.. figure:: {filename}/images/idle-1.png
+ :align: center
+ :alt: IDLE window
+
+ Snapshot of the source code
+
+Running the program
+~~~~~~~~~~~~~~~~~~~
+
+To run the program, click on ``Run > Run Module`` and you should see
+the Mandelbrot set in the matplotlib window.
+
+.. figure:: {filename}/images/idle-2.png
+ :align: center
+ :alt: Mandelbrot Set
+
+ Mandelbrot set
+
+All the solutions should be ready to run, try them out, make changes
+to experiment and let me know what you come up with!
+
+Email me at ``doingmathwithpython@gmail.com`` or post your query/tip to any of the
+following community forums:
+
+- `Facebook page `__
+- `G+ Community `__
diff --git a/content/video-pycon-australia-doing-math-with-python.rst b/content/video-pycon-australia-doing-math-with-python.rst
new file mode 100644
index 0000000..dd2cb79
--- /dev/null
+++ b/content/video-pycon-australia-doing-math-with-python.rst
@@ -0,0 +1,18 @@
+Video: Doing Math with Python
+=============================
+
+:date: 2016-08-16 12:00
+:category: updates
+:slug: video-pyconau-dmwp
+:summary: PyConAU2016
+
+
+I spoke at the PyCon Australia Education Seminar on August 12, 2016. The video of the talk is now up.
+Thanks to Next Day Video!
+
+.. youtube:: XJOt4QQgx0A
+
+The PDF slides and the demos as Jupyter Notebooks (Python 3) are `here `__. I have some instructions to download them and try them out. If you face any issues, or have a question, please let me know.
+
+Thank you to all the PyCon Australia organizers and the Education seminar organizers for a great mini conference
+and the opportunity to be a part of it.
diff --git a/content/what-readers-are-saying.rst b/content/what-readers-are-saying.rst
new file mode 100644
index 0000000..4eab3b6
--- /dev/null
+++ b/content/what-readers-are-saying.rst
@@ -0,0 +1,33 @@
+What readers are saying
+=======================
+
+:date: 2016-02-14 10:00
+:category: updates
+:slug: what-readers-are-saying
+:summary: Reviews of Doing Math with Python
+
+Readers have shared how they are finding *Doing Math with Python* by
+posting reviews on Amazon and their own blog. You can view all of them
+on the `Reviews <{filename}pages/reviews.rst>`__ page.
+
+Some readers have also been kind enough to let me know personally how the book
+has helped them to restart their programming, or looking at something
+they have been putting off. As the author, I think this is the highest
+level of appreciation that I could have hoped for.
+
+Recently, Aaron Meurer (the lead developer of SymPy) mentioned the
+book in an `episode `__ of
+Podcast.__init__ titled "SymPy with Aaron Meurer". If you are curious
+to learn more about SymPy, I would recommend listening to it.
+
+I am curious to hear more. If you want to get in touch personally,
+please do so via any of the following channels:
+
+- `Facebook page `__
+- `G+ Community `__
+- `Twitter `__
+
+You can email me at doingmathwithpython@gmail.com.
+
+Alternatively, if you just plan to write a review, please do so on
+Amazon, O'Reilly or your personal blog.
diff --git a/content/working-on-ubuntu-1604.rst b/content/working-on-ubuntu-1604.rst
new file mode 100644
index 0000000..b047221
--- /dev/null
+++ b/content/working-on-ubuntu-1604.rst
@@ -0,0 +1,44 @@
+Trying out the code on Ubuntu 16.04
+===================================
+
+:date: 2016-10-05 09:00
+:category: tips
+:slug: install-on-ubuntu16.04
+:summary: Code on Ubuntu 15.04
+
+If you are using Ubuntu 16.04 and don't want to install the Anaconda
+Python distribution for trying out the book's
+`programs `__ or
+the `sample solutions
+`__, this
+post is for you.
+
+Ubuntu 16.04 already comes with Python 3 installed, so we only need to install
+the following packages - matplotlib, matplotlib-venn, sympy and idle3.
+
+Open a terminal and do the following:
+
+.. code::
+
+ $ sudo apt-get update
+ $ sudo apt-get install python3-matplotlib python3-matplotlib-venn python3-sympy idle3
+
+
+It's worth noting that this will install sympy 0.7.6 and matplotlib 1.5.1 which are
+both sufficient for the book's programs.
+
+Starting IDLE editor
+~~~~~~~~~~~~~~~~~~~~
+
+You can now start the IDLE editor by typing in "idle3" from the terminal and then it's ready
+for your programs!
+
+Contact
+~~~~~~~
+
+If you find any issues please email me at
+``doingmathwithpython@gmail.com`` or post your query/tip to any of the
+following community forums:
+
+- `Facebook page `__
+- `G+ Community `__
diff --git a/develop_server.sh b/develop_server.sh
new file mode 100755
index 0000000..ed6f286
--- /dev/null
+++ b/develop_server.sh
@@ -0,0 +1,103 @@
+#!/usr/bin/env bash
+##
+# This section should match your Makefile
+##
+PY=python
+PELICAN=pelican
+PELICANOPTS=
+
+BASEDIR=$(pwd)
+INPUTDIR=$BASEDIR/content
+OUTPUTDIR=$BASEDIR/output
+CONFFILE=$BASEDIR/pelicanconf.py
+
+###
+# Don't change stuff below here unless you are sure
+###
+
+SRV_PID=$BASEDIR/srv.pid
+PELICAN_PID=$BASEDIR/pelican.pid
+
+function usage(){
+ echo "usage: $0 (stop) (start) (restart) [port]"
+ echo "This starts pelican in debug and reload mode and then launches"
+ echo "A pelican.server to help site development. It doesn't read"
+ echo "your pelican options so you edit any paths in your Makefile"
+ echo "you will need to edit it as well"
+ exit 3
+}
+
+function alive() {
+ kill -0 $1 >/dev/null 2>&1
+}
+
+function shut_down(){
+ PID=$(cat $SRV_PID)
+ if [[ $? -eq 0 ]]; then
+ if alive $PID; then
+ echo "Killing pelican.server"
+ kill $PID
+ else
+ echo "Stale PID, deleting"
+ fi
+ rm $SRV_PID
+ else
+ echo "pelican.server PIDFile not found"
+ fi
+
+ PID=$(cat $PELICAN_PID)
+ if [[ $? -eq 0 ]]; then
+ if alive $PID; then
+ echo "Killing Pelican"
+ kill $PID
+ else
+ echo "Stale PID, deleting"
+ fi
+ rm $PELICAN_PID
+ else
+ echo "Pelican PIDFile not found"
+ fi
+}
+
+function start_up(){
+ local port=$1
+ echo "Starting up Pelican and pelican.server"
+ shift
+ $PELICAN --debug --autoreload -r $INPUTDIR -o $OUTPUTDIR -s $CONFFILE $PELICANOPTS &
+ pelican_pid=$!
+ echo $pelican_pid > $PELICAN_PID
+ cd $OUTPUTDIR
+ $PY -m pelican.server $port &
+ srv_pid=$!
+ echo $srv_pid > $SRV_PID
+ cd $BASEDIR
+ sleep 1
+ if ! alive $pelican_pid ; then
+ echo "Pelican didn't start. Is the pelican package installed?"
+ return 1
+ elif ! alive $srv_pid ; then
+ echo "pelican.server didn't start. Is there something else which uses port 8000?"
+ return 1
+ fi
+ echo 'Pelican and pelican.server processes now running in background.'
+}
+
+###
+# MAIN
+###
+[[ ($# -eq 0) || ($# -gt 2) ]] && usage
+port=''
+[[ $# -eq 2 ]] && port=$2
+
+if [[ $1 == "stop" ]]; then
+ shut_down
+elif [[ $1 == "restart" ]]; then
+ shut_down
+ start_up $port
+elif [[ $1 == "start" ]]; then
+ if ! start_up $port; then
+ shut_down
+ fi
+else
+ usage
+fi
diff --git a/education-summit-pycon-2016.html b/education-summit-pycon-2016.html
deleted file mode 100644
index 7e247fb..0000000
--- a/education-summit-pycon-2016.html
+++ /dev/null
@@ -1,151 +0,0 @@
-
-
-
-
-
-
- Python 2016 Education Summit Notes
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/fabfile.py b/fabfile.py
new file mode 100644
index 0000000..817f448
--- /dev/null
+++ b/fabfile.py
@@ -0,0 +1,60 @@
+from fabric.api import *
+import fabric.contrib.project as project
+import os
+
+# Local path configuration (can be absolute or relative to fabfile)
+env.deploy_path = 'output'
+DEPLOY_PATH = env.deploy_path
+
+# Remote server configuration
+production = 'root@localhost:22'
+dest_path = '/var/www'
+
+# Rackspace Cloud Files configuration settings
+env.cloudfiles_username = 'my_rackspace_username'
+env.cloudfiles_api_key = 'my_rackspace_api_key'
+env.cloudfiles_container = 'my_cloudfiles_container'
+
+
+def clean():
+ if os.path.isdir(DEPLOY_PATH):
+ local('rm -rf {deploy_path}'.format(**env))
+ local('mkdir {deploy_path}'.format(**env))
+
+def build():
+ local('pelican -s pelicanconf.py')
+
+def rebuild():
+ clean()
+ build()
+
+def regenerate():
+ local('pelican -r -s pelicanconf.py')
+
+def serve():
+ local('cd {deploy_path} && python -m SimpleHTTPServer'.format(**env))
+
+def reserve():
+ build()
+ serve()
+
+def preview():
+ local('pelican -s publishconf.py')
+
+def cf_upload():
+ rebuild()
+ local('cd {deploy_path} && '
+ 'swift -v -A https://auth.api.rackspacecloud.com/v1.0 '
+ '-U {cloudfiles_username} '
+ '-K {cloudfiles_api_key} '
+ 'upload -c {cloudfiles_container} .'.format(**env))
+
+@hosts(production)
+def publish():
+ local('pelican -s publishconf.py')
+ project.rsync_project(
+ remote_dir=dest_path,
+ exclude=".DS_Store",
+ local_dir=DEPLOY_PATH.rstrip('/') + '/',
+ delete=True
+ )
diff --git a/feeds/all-en.atom.xml b/feeds/all-en.atom.xml
deleted file mode 100644
index 490a998..0000000
--- a/feeds/all-en.atom.xml
+++ /dev/null
@@ -1,855 +0,0 @@
-
-Doing Math with Pythonhttp://doingmathwithpython.github.io/2023-10-25T13:20:00+10:00Doing Math with Python in Data Science Humble Bundle2023-10-25T13:20:00+10:002023-10-25T13:20:00+10:00Amit Sahatag:doingmathwithpython.github.io,2023-10-25:/humble-bundle-data-science.html<p class="first last">Humble bundle</p>
-<p>"Doing Math with Python" is part of No Starch Press's <a class="reference external" href="https://www.humblebundle.com/books/data-science-no-starch-press-books">Data Science Humble Bundle</a>
-running for the next 19 days. Your purchases will help support EFF!</p>
-<div class="figure align-center">
-<img alt="Humble Bundle" src="http://doingmathwithpython.github.io/images/data-science-humble-bundle.png" />
-</div>
-<p>Get the bundle <a class="reference external" href="https://www.humblebundle.com/books/data-science-no-starch-press-books">here</a>!</p>
-<p>I am still surprised that the book still continues to be relevant, and i am quietly happy that I could produce such a book,
-thanks to all the help i got from No Starch folks.</p>
-Chapter 3 - Google Correlate example update2020-07-11T00:00:00+10:002020-07-11T00:00:00+10:00Amit Sahatag:doingmathwithpython.github.io,2020-07-11:/chapter-3-google-correlate-example-update.html<p>In Chapter 3 on Page 87, the book refers to the Google Correlate service. However, as of December 2019, the service has been shutdown.
-Since the chapter requires you to download a CSV formatted data, it is no longer possible. However, you can instead download a version of
-the data …</p><p>In Chapter 3 on Page 87, the book refers to the Google Correlate service. However, as of December 2019, the service has been shutdown.
-Since the chapter requires you to download a CSV formatted data, it is no longer possible. However, you can instead download a version of
-the data that I had used 5 years back when writing the book from
-<a class="reference external" href="https://github.com/doingmathwithpython/code/blob/master/chapter3/solutions/correlate-summer.csv">here</a>.</p>
-<p>Thanks to a reader for pointing me to this issue.</p>
-Coding Starter Kit Humble Bundle2020-03-17T00:00:00+10:002020-03-17T00:00:00+10:00Amit Sahatag:doingmathwithpython.github.io,2020-03-17:/humble-bundle-coding-starter.html<p>I am very excited to share that "Doing Math with Python" is part of No Starch Press's <a class="reference external" href="https://www.humblebundle.com/books/coding-starter-kit-no-starch-press-books?mc_cid=01272437d1&mc_eid=a8fa0cb420">Coding Starter Humble Bundle</a>.
-Of course, you get No Starch Press's other excellent coding books as part of the bundle.</p>
-<p>It's on for the next 20 days!</p>
-<div class="figure align-left">
-<img alt="Humble Bundle" src="http://doingmathwithpython.github.io/images/coding-starter-humble-bundle.png" />
-</div>
-<p>Your purchases will help support the …</p><p>I am very excited to share that "Doing Math with Python" is part of No Starch Press's <a class="reference external" href="https://www.humblebundle.com/books/coding-starter-kit-no-starch-press-books?mc_cid=01272437d1&mc_eid=a8fa0cb420">Coding Starter Humble Bundle</a>.
-Of course, you get No Starch Press's other excellent coding books as part of the bundle.</p>
-<p>It's on for the next 20 days!</p>
-<div class="figure align-left">
-<img alt="Humble Bundle" src="http://doingmathwithpython.github.io/images/coding-starter-humble-bundle.png" />
-</div>
-<p>Your purchases will help support the No Starch Foundation and Scratch Foundation.</p>
-<p>Get the bundle <a class="reference external" href="https://www.humblebundle.com/books/coding-starter-kit-no-starch-press-books?mc_cid=01272437d1&mc_eid=a8fa0cb420">here</a>.</p>
-Number of trailing zeros in the factorial of an integer2020-01-02T19:50:00+10:002020-01-02T19:50:00+10:00Amit Sahatag:doingmathwithpython.github.io,2020-01-02:/trailing-zeros-factorial.html<p class="first last">Use Python to find the number of trailing zeros in the factorial of an integer</p>
-<p>I recently learned about a cool formula to calculate the number of
-trailing zeros in the factorial of a number. It has been a while since I
-wrote a program to do something like this. So, I decided to change that and
-write this blog post. Let's jump in.</p>
-<p>In the spirit of wring various "calculators" in the book, we will
-write a "number of trailing zero" calculator. First up though, let's refresh
-some key relevant concepts.</p>
-<p><strong>Factorial</strong>: The factorial of a number, <tt class="docutils literal">n</tt> denoted by <tt class="docutils literal">n!</tt> is the product <tt class="docutils literal"><span class="pre">n*(n-1)*(n-2)...*1</span></tt>.
-For example, <tt class="docutils literal">5! = 5*4*3*2*1 = 120</tt>.</p>
-<p><strong>Trailing zeros</strong>: The trailing zeros of a number is the number of zeros at the end of a number. For example,
-the number 567100 has <strong>two</strong> trailing zeros.</p>
-<p><strong>Floor</strong>: The floor of a number is the greatest integer less than or equal to x. That is floor of 3.2 is 3
-and that of 3.5 is 3 and the floor of 3 is 3 as well.</p>
-<p>Now, coming back to the focus of this post, this document at brilliant.org wiki
-explains the process in <a class="reference external" href="https://brilliant.org/wiki/trailing-number-of-zeros/">detail</a>.</p>
-<p>The key bit there in is this formula:</p>
-<div class="figure">
-<img alt="" src="http://doingmathwithpython.github.io/images/trailing_zeros_formula.png" />
-</div>
-<p>where, <tt class="docutils literal">n</tt> is the number for whose factorial we want to find the number of trailing zeros.</p>
-<p>The following Python program implements the above formula:</p>
-<pre class="code literal-block">
-import math
-
-
-def is_positive_integer(x):
- try:
- x = float(x)
- except ValueError:
- return False
- else:
- if x.is_integer() and x > 0:
- return True
- else:
- return False
-
-
-def trailing_zeros(num):
- if is_positive_integer(num):
- # The above function call has done all the sanity checks for us
- # so we can just convert this into an integer here
- num = int(num)
-
- k = math.floor(math.log(num, 5))
- zeros = 0
- for i in range(1, k + 1):
- zeros = zeros + math.floor(num/math.pow(5, i))
- return zeros
- else:
- print("Factorial of a non-positive non-integer is undefined")
-
-
-if __name__ == "__main__":
- fact_num = input(
- "Enter the number whose factorial's trailing zeros you want to find: "
- )
- num_zeros = trailing_zeros(fact_num)
- print("Number of trailing zeros: {0}".format(num_zeros))
-</pre>
-<p>When we run this program using Python 3, it will ask for the number whose factorial's number of trailing
-zeros we want to find and then print it out, like so:</p>
-<pre class="code literal-block">
-Enter the number whose factorial's trailing zeros you want to find: 5
-Number of trailing zeros: 1
-</pre>
-<p>If you enter a number which is not a positive integer, you will get an error message:</p>
-<pre class="code literal-block">
-Enter the number whose factorial's trailing zeros you want to find: 5.1
-Factorial of a non-positive integer is undefined
-Number of trailing zeros: None
-</pre>
-<p>Some key standard library functions we use in the above program are:</p>
-<ul class="simple">
-<li><tt class="docutils literal">math.floor</tt>: This function is used to find the floor of a number</li>
-<li><tt class="docutils literal">math.log</tt>: This function is used to find the logarithm of a number for a specified base (defaults to 10)</li>
-<li><tt class="docutils literal">math.pow</tt>: This function is used to find out the power of a number raised to another</li>
-</ul>
-<p>The above functions are defined in the <a class="reference external" href="https://docs.python.org/3/library/math.html">math module</a>.</p>
-<p>Besides the above, we use the <cite>is_integer()</cite> function defined on a floating point object to check
-if the floating point object is actually an integer.</p>
-<p>The latest version of the code is available <a class="reference external" href="https://github.com/doingmathwithpython/code/blob/master/explorations/trailing_zeros/trailing_zeros.py">here</a>.</p>
-Doing Math with Python in Python Humble Bundle2019-08-23T00:00:00+10:002019-08-23T00:00:00+10:00Amit Sahatag:doingmathwithpython.github.io,2019-08-23:/humble-bundle-python.html<p class="first last">Humble bundle Python</p>
-<p>"Doing Math with Python" is part of No Starch Press's <a class="reference external" href="https://www.humblebundle.com/books/python-programming-no-starch-books">Python Humble Bundle</a>.
-Of course, you get No Starch Press's other excellent Python books as part of the bundle. It's still on for the next 10 days!</p>
-<div class="figure align-left">
-<img alt="Humble Bundle" src="http://doingmathwithpython.github.io/images/python-humble-bundle.png" />
-</div>
-<p>Your purchases will help support the No Starch Foundation and Python Software Foundation.</p>
-<p>Get the bundle <a class="reference external" href="https://www.humblebundle.com/books/python-programming-no-starch-books">here</a>.</p>
-Doing Math with Python in Coder's Bookshelf Humble Bundle2019-03-29T00:00:00+10:002019-03-29T00:00:00+10:00Amit Sahatag:doingmathwithpython.github.io,2019-03-29:/humble-bundle-coders-bookshelf.html<p class="first last">Humble bundle</p>
-<p>"Doing Math with Python" is part of No Starch Press's "Pay what you want" <a class="reference external" href="https://www.humblebundle.com/books/coders-bookshelf-books">Coder's Bookshelf Bundle</a>.
-Your purchases will help support a charity of your choice.</p>
-<div class="figure align-center">
-<img alt="Humble Bundle" src="http://doingmathwithpython.github.io/images/humble-bundle-3.png" />
-</div>
-<p>Get the bundle <a class="reference external" href="https://www.humblebundle.com/books/coders-bookshelf-books">here</a>!</p>
-Doing Math with Python in Linux Geek Humble Bundle2018-07-24T13:20:00+10:002018-07-24T13:20:00+10:00Amit Sahatag:doingmathwithpython.github.io,2018-07-24:/humble-bundle-linux-geek.html<p class="first last">Humble bundle</p>
-<p>"Doing Math with Python" is part of No Starch Press's "Pay what you want" <a class="reference external" href="https://www.humblebundle.com/books/linux-geek-books">Linux Geek Humble Bundle</a>
-running for the next 7 days. Your purchases will help support EFF or a charity of your choice.</p>
-<div class="figure align-center">
-<img alt="Humble Bundle" src="http://doingmathwithpython.github.io/images/humble-bundle-2.png" />
-</div>
-<p>Get the bundle <a class="reference external" href="https://www.humblebundle.com/books/linux-geek-books">here</a>!</p>
-Anaconda 5.0 release2017-10-29T19:50:00+10:002017-10-29T19:50:00+10:00Amit Sahatag:doingmathwithpython.github.io,2017-10-29:/anaconda-5.0.html<p class="first last">Anaconda 5.0 release</p>
-<p><a class="reference external" href="https://www.anaconda.com/blog/developer-blog/announcing-the-release-of-anaconda-distribution-5-0/">Anaconda 5.0</a>
-was released a few days back. I tried all the <a class="reference external" href="http://doingmathwithpython.github.io/trying-out-solutions.html">sample solutions</a>
-and everything works as expected. The <a class="reference external" href="http://doingmathwithpython.github.io/pages/programs.html">chapter programs</a> should
-keep working as well.</p>
-<p>The versions of the relevant software in this release are:</p>
-<ul class="simple">
-<li>Python 3.6</li>
-<li>sympy 1.1.1</li>
-<li>matplotlib 2.1.0</li>
-</ul>
-<p>You can update your existing installation using:</p>
-<pre class="code literal-block">
-$ conda update conda
-$ conda install anaconda=5.0
-</pre>
-<p>(Thanks to Dan Wolfe for informing me of the incorrect command to install <cite>anaconda=5.0</cite>)</p>
-<p>A fresh installation of Anaconda 5.0 should still be similar to the <a class="reference external" href="https://doingmathwithpython.github.io/pages/software-installation.html">instructions</a>
-for earlier versions.</p>
-<div class="figure align-center">
-<img alt="Anaconda 5" src="http://doingmathwithpython.github.io/images/anaconda-5.png" />
-</div>
-<div class="figure align-center">
-<img alt="Anaconda 5" src="http://doingmathwithpython.github.io/images/anaconda-install-1.png" />
-</div>
-<div class="figure align-center">
-<img alt="Anaconda 5" src="http://doingmathwithpython.github.io/images/anaconda-install-2.png" />
-</div>
-<div class="figure align-center">
-<img alt="Anaconda 5" src="http://doingmathwithpython.github.io/images/anaconda-install-3.png" />
-</div>
-<p>I have so far verified both on Mac OS X and Linux. If you find any
-issues on Windows, please email me at
-<tt class="docutils literal">doingmathwithpython@gmail.com</tt> or post your query/tip to any of the
-following community forums:</p>
-<ul class="simple">
-<li><a class="reference external" href="https://www.facebook.com/doingmathwithpython">Facebook page</a></li>
-<li><a class="reference external" href="https://plus.google.com/u/0/communities/113121562865298236232">G+ Community</a></li>
-</ul>
-Doing Math with Python Humble Bundle2017-04-06T08:20:00+10:002017-04-06T08:20:00+10:00Amit Sahatag:doingmathwithpython.github.io,2017-04-06:/humble-bundle.html<p class="first last">Humble bundle</p>
-<p>No Starch Press has launched a "Pay what you want" <a class="reference external" href="https://www.humblebundle.com/books/python-book-bundle">Python Humble Bundle</a> running from April 5th - April 19th!
-Your purchases will help support the Python Software Foundation and I am excited to announce that Doing Math with Python is part of it.</p>
-<div class="figure align-center">
-<img alt="Humble Bundle" src="http://doingmathwithpython.github.io/images/humble-bundle.png" />
-</div>
-<p>For 1+ USD you can get three books including "Doing Math with Python"! For 15+ USD you get nine excellent Python books!</p>
-<p>Get the bundle <a class="reference external" href="https://www.humblebundle.com/books/python-book-bundle">here</a>!</p>
-Trying out the code on Ubuntu 16.042016-10-05T09:00:00+10:002016-10-05T09:00:00+10:00Amit Sahatag:doingmathwithpython.github.io,2016-10-05:/install-on-ubuntu16.04.html<p class="first last">Code on Ubuntu 15.04</p>
-<p>If you are using Ubuntu 16.04 and don't want to install the Anaconda
-Python distribution for trying out the book's
-<a class="reference external" href="http://doingmathwithpython.github.io/pages/programs.html">programs</a> or
-the <a class="reference external" href="http://doingmathwithpython.github.io/trying-out-solutions.html">sample solutions</a>, this
-post is for you.</p>
-<p>Ubuntu 16.04 already comes with Python 3 installed, so we only need to install
-the following packages - matplotlib, matplotlib-venn, sympy and idle3.</p>
-<p>Open a terminal and do the following:</p>
-<pre class="code literal-block">
-$ sudo apt-get update
-$ sudo apt-get install python3-matplotlib python3-matplotlib-venn python3-sympy idle3
-</pre>
-<p>It's worth noting that this will install sympy 0.7.6 and matplotlib 1.5.1 which are
-both sufficient for the book's programs.</p>
-<div class="section" id="starting-idle-editor">
-<h2>Starting IDLE editor</h2>
-<p>You can now start the IDLE editor by typing in "idle3" from the terminal and then it's ready
-for your programs!</p>
-</div>
-<div class="section" id="contact">
-<h2>Contact</h2>
-<p>If you find any issues please email me at
-<tt class="docutils literal">doingmathwithpython@gmail.com</tt> or post your query/tip to any of the
-following community forums:</p>
-<ul class="simple">
-<li><a class="reference external" href="https://www.facebook.com/doingmathwithpython">Facebook page</a></li>
-<li><a class="reference external" href="https://plus.google.com/u/0/communities/113121562865298236232">G+ Community</a></li>
-</ul>
-</div>
-Video: Doing Math with Python2016-08-16T12:00:00+10:002016-08-16T12:00:00+10:00Amit Sahatag:doingmathwithpython.github.io,2016-08-16:/video-pyconau-dmwp.html<p class="first last">PyConAU2016</p>
-<p>I spoke at the PyCon Australia Education Seminar on August 12, 2016. The video of the talk is now up.
-Thanks to Next Day Video!</p>
-<div class="youtube youtube-16x9"><iframe src="https://www.youtube.com/embed/XJOt4QQgx0A" allowfullscreen seamless frameBorder="0"></iframe></div><p>The PDF slides and the demos as Jupyter Notebooks (Python 3) are <a class="reference external" href="https://github.com/doingmathwithpython/pycon-au-2016">here</a>. I have some instructions to download them and try them out. If you face any issues, or have a question, please let me know.</p>
-<p>Thank you to all the PyCon Australia organizers and the Education seminar organizers for a great mini conference
-and the opportunity to be a part of it.</p>
-PyCon Australia 2016 Education Seminar2016-08-12T11:27:00+10:002016-08-12T11:27:00+10:00Amit Sahatag:doingmathwithpython.github.io,2016-08-12:/pycon-au-edu-summit-talk.html<p class="first last">PyCon AU education summit talk</p>
-<p>I attended the PyCon Australia 2016 Education seminar held on 12th August at Melbourne, Australia.
-I loved the energy of the seminar and was great to hear about all the ways educators in Australia are
-using Python for their teaching. Here are some notes I took, which I also link with the videos. You can
-find all the videos <a class="reference external" href="https://www.youtube.com/playlist?list=PLs4CJRBY5F1Jh6fFqT1p5TZRx5q06CcaR">here</a>.</p>
-<div class="section" id="python-at-monash">
-<h2>Python at Monash</h2>
-<ul class="simple">
-<li>Faculty of IT</li>
-<li>Python close to pseudocode</li>
-<li>Jupyter Notebooks</li>
-<li>Jupyter Hub installation at Monash</li>
-</ul>
-</div>
-<div class="section" id="keynote-smart-city-from-earth-to-mars-and-back">
-<h2>Keynote: Smart City - From earth to mars and back</h2>
-<ul class="simple">
-<li><a class="reference external" href="https://www.youtube.com/watch?v=BZExUKogvjQ&list=PLs4CJRBY5F1Jh6fFqT1p5TZRx5q06CcaR&index=8">Video</a></li>
-<li>Find a social mission</li>
-</ul>
-</div>
-<div class="section" id="teaching-python">
-<h2>Teaching Python</h2>
-<ul class="simple">
-<li><a class="reference external" href="https://www.youtube.com/watch?v=7oIwVjEVn0c&list=PLs4CJRBY5F1Jh6fFqT1p5TZRx5q06CcaR&index=9">Video</a></li>
-<li>Teaching isn't easy</li>
-<li>Programming isn't easy, it's new</li>
-<li>Grok learning, interactivepython.org, coursera, codecadaemy..</li>
-<li>Emphasise the fundamentals, don't assume anything, be explicit</li>
-</ul>
-</div>
-<div class="section" id="python-with-minecraft">
-<h2>Python with Minecraft</h2>
-<ul class="simple">
-<li><a class="reference external" href="https://www.youtube.com/watch?v=WwKkA9YV1K8&list=PLs4CJRBY5F1Jh6fFqT1p5TZRx5q06CcaR&index=7">Video</a></li>
-<li>Get kids excited</li>
-<li>Consumers to creators</li>
-</ul>
-</div>
-<div class="section" id="micropython">
-<h2>MicroPython</h2>
-<ul class="simple">
-<li><a class="reference external" href="https://www.youtube.com/watch?v=oCEZyJqkMrE&list=PLs4CJRBY5F1Jh6fFqT1p5TZRx5q06CcaR&index=6">Video</a></li>
-<li>Groklearning Microbit</li>
-<li><a class="reference external" href="https://groklearning.com/competition/codequest-microbit-2016/">https://groklearning.com/competition/codequest-microbit-2016/</a></li>
-</ul>
-</div>
-<div class="section" id="teaching-geometry-using-logo-python-turtle-module">
-<h2>Teaching Geometry using Logo/Python turtle module</h2>
-<ul class="simple">
-<li><a class="reference external" href="https://www.youtube.com/watch?v=gu3QDizt-_Y&list=PLs4CJRBY5F1Jh6fFqT1p5TZRx5q06CcaR&index=5">Video</a></li>
-<li>Don't teach subjects in silos</li>
-<li>Show students you can do real useful stuff with programming</li>
-<li>Turtle powered Geometry</li>
-<li>Grok learning lessons (turtle in your browser)</li>
-</ul>
-</div>
-PyCon Australia 2016 Education Seminar: Doing Math with Python2016-08-06T18:00:00+10:002016-08-06T18:00:00+10:00Amit Sahatag:doingmathwithpython.github.io,2016-08-06:/pyconau-dmwp.html<p class="first last">PyConAU2016</p>
-<p>Hello everyone, I will be <a class="reference external" href="https://2016.pycon-au.org/schedule/83/view_talk?day=friday">speaking</a> at the PyCon AU education seminar coming August 12, 2016 at Melbourne, Australia (3.00 - 3.40 PM).</p>
-<p>I have put up my in progress slides (PDF) and the demos as Jupyter Notebooks (Python 3), I plan to use during the talk on <a class="reference external" href="https://github.com/doingmathwithpython/pycon-au-2016">GitHub</a>. If you are coming along, please let me know if there is anything specific I can share and discuss.</p>
-<p><strong>Links</strong></p>
-<ul class="simple">
-<li><a class="reference external" href="https://2016.pycon-au.org/schedule/83/view_talk?day=friday">Talk abstract</a></li>
-<li><a class="reference external" href="https://github.com/doingmathwithpython/pycon-au-2016">Slides and Demos</a></li>
-</ul>
-O'Reilly Webcast: Doing Math with Python2016-07-01T14:00:00+10:002016-07-01T14:00:00+10:00Amit Sahatag:doingmathwithpython.github.io,2016-07-01:/oreilly-webcast-doing-math.html<p class="first last">O'Reilly Webcast</p>
-<p><strong>Updated post after the webcast</strong></p>
-<p>A big thank you to all of you who turned up for the webcast across the world. I really had a great time and hope the session was informative to all of you. For those who didn't make it to the webcast, it's now available for <a class="reference external" href="http://www.oreilly.com/pub/e/3712">viewing</a>.</p>
-<p>The slides, transcript and the demos are all available at the <a class="reference external" href="https://github.com/doingmathwithpython/oreilly-webcast-2016">GitHub repository</a>. Feel free to use them in any capacity you find useful. If you already have <a class="reference external" href="https://doingmathwithpython.github.io/pages/software-installation.html">Anaconda installed</a>, get the above code, and run <cite>jupyter-notebook</cite> from the same directory to be able to play with the code.</p>
-<p><em>Links of Interest</em></p>
-<ul class="simple">
-<li><a class="reference external" href="http://www.oreilly.com/pub/e/3712">Webcast Recording</a></li>
-<li><a class="reference external" href="https://github.com/doingmathwithpython/oreilly-webcast-2016">Slides, Transcript and Demos</a></li>
-<li><a class="reference external" href="https://www.nostarch.com/doingmathwithpython">Doing Math with Python book</a></li>
-</ul>
-<p>Some of you asked a number of questions which I couldn't answer as well as I would have wanted to during the webcast, so I will make a better attempt below:</p>
-<p><strong>Q: What is the difference between an interpreter, ide and text editor? And what do you recommend for beginners?</strong></p>
-<p>An <tt class="docutils literal">interpreter</tt> is what runs your program. Without going into the details, the Python interpreter is what converts a statement such as <tt class="docutils literal"><span class="pre">print("Hello")</span></tt> to a form that can be understood by the computer to finally print <tt class="docutils literal">Hello</tt> on screen.
-An <tt class="docutils literal">IDE</tt> or Integrated Development Environment is a software application where we can write programs and run them usually via Graphical User Interface. IDEs generally feature helpful features such as code completion and can be useful when working with large projects. A <tt class="docutils literal">text editor</tt> is for writing our programs or other text. It usually doesn't support features that an IDE would support but of course, you can configure and enhance text editors to give you IDE-like features.</p>
-<p>For beginners, I recommend starting with text editors. I think that doesn't overwhelm someone who is learning with the IDE features. That said, <a class="reference external" href="https://docs.python.org/3/library/idle.html">IDLE</a> is a good in-between choice for beginners and one that I personally use in the book and definitely would be my first choice.</p>
-<p><strong>Q: What library do we use for importing metric units that works well with sympy?</strong></p>
-<p>I would recommend taking a look at SymPy's <a class="reference external" href="http://docs.sympy.org/dev/modules/physics/units.html#">Units</a> module and see if it has what you need. In addition, and if you already don't know about it, <a class="reference external" href="https://github.com/hgrecco/pint">pint</a> would be another library to look at.</p>
-<p><strong>Q: Do you use notebook for exploratory work?</strong></p>
-<p>Yes, I use notebook for exploratory work. I think notebooks are great when you want the code and result together in a single document. It's great for sharing too. I recently created <a class="reference external" href="http://echorand.me/presentation-slides-with-jupyter-notebook.html#.V3XhNe0yphE">slides</a> as a Notebook.</p>
-<p><strong>Q: Can Sympy be used for the development in a engineering software (i.e. Finite Element Method)? Would the computational speed be (good)? (Not sure about the second part of the question)</strong></p>
-<p>You may be interested in taking a look at <a class="reference external" href="http://sfepy.org/doc-devel/index.html">SfePy</a></p>
-<p><strong>Q: Thoughts on Cython? Sagemath?</strong></p>
-<p>I haven't worked much with Cython. I know about it and what it can useful for. So, I guess if you are looking for speed, definitely look into it. I would also recommend looking at <a class="reference external" href="http://numba.pydata.org/">Numba</a>. Sagemath is more of a system itself than a library. It integrates popular Python libraries and would definitely be something to explore.</p>
-<p><strong>Q: Should students use IDLE or a notebook format?</strong></p>
-<p>I would recommend using IDLE to start with. It gives the opportunity for the student to at least get an idea of the cycle of editing code and running it. I would only introduce notebook later and in addition to IDLE. Both have their merits, but Notebook just introduces one more thing to grasp in the beginning.</p>
-<p><strong>Q: Any recommendations for introducing 3D graphics e.g. polyhedrons on screen?</strong></p>
-<p>I haven't explored them, you may want to look at <a class="reference external" href="https://pi3d.github.io/html/">Pi3D</a> or <a class="reference external" href="http://vpython.org/">VPython</a>.</p>
-<p><strong>Q: How well do SymPy and Numpy work together?</strong></p>
-<p>No personal experience, but searching a bit, it looks like you may want to look at SymPy's <a class="reference external" href="http://docs.sympy.org/dev/modules/utilities/lambdify.html">Lambdify</a> feature. The <a class="reference external" href="https://groups.google.com/forum/#!forum/sympy">SymPy google group</a> may give you a better answer.</p>
-<p><strong>Q: You are working in Jupyter - can the "app"s you should be embedded in a regular HTML web page?</strong></p>
-<p>I haven't personally tried this. I think this <a class="reference external" href="https://jakevdp.github.io/blog/2013/12/05/static-interactive-widgets/">post</a> may give you clues to do it. O'Reilly Media's project <a class="reference external" href="https://github.com/oreillymedia/thebe">thebe</a> may be another option to look at.</p>
-<p><strong>Announcement post</strong></p>
-<p>I am very excited to share that I am doing a webcast this coming week with O'Reilly titled
-"Doing Math with Python". You can register for it on the <a class="reference external" href="http://www.oreilly.com/pub/e/3712">event page</a>.</p>
-<p>Here are the date and time of the webcast:</p>
-<ul class="simple">
-<li>Wed, June 29th at 7 PM, San Francisco</li>
-<li>Wed, June 29th at 10pm, New York</li>
-<li>Thu, Jun 30th at 3am - London</li>
-<li>Thu, Jun 30th at 7:30am - Mumbai</li>
-<li>Thu, Jun 30th at 10am - Beijing</li>
-<li>Thu, Jun 30th at 11am - Tokyo</li>
-<li>Thu, Jun 30th at 12pm - Sydney</li>
-</ul>
-<p>I have created a <a class="reference external" href="https://github.com/doingmathwithpython/oreilly-webcast-2016">GitHub repository</a> which
-will have the rough transcript, final slides and the code examples as Jupyter Notebooks.</p>
-Python 2016 Education Summit Notes2016-05-29T17:00:00+10:002016-05-29T17:00:00+10:00Amit Sahatag:doingmathwithpython.github.io,2016-05-29:/education-summit-pycon-2016.html<p class="first last">Education Summit Summary</p>
-<p>I participated in the education summit today. My talk slides for "Doing Math with Python" is available <a class="reference external" href="https://doingmathwithpython.github.io/pycon-us-2016/#/">here</a>.</p>
-<p>Here are some notes on the other talks I attended.</p>
-<div class="section" id="keynote">
-<h2>Keynote</h2>
-<ul class="simple">
-<li>Education WG</li>
-<li>PythonZero</li>
-<li>GPIO Zero</li>
-<li>Network zero: <a class="reference external" href="https://github.com/tjguk/networkzero/">https://github.com/tjguk/networkzero/</a></li>
-<li>Zero: based on an established package, emphasis is on up-and-running use in a classroom, Relevant error messages</li>
-</ul>
-<p>Micro:bit</p>
-<ul class="simple">
-<li>Mu, demos</li>
-</ul>
-</div>
-<div class="section" id="lessons-learned-from-teaching-python">
-<h2>Lessons learned from teaching Python</h2>
-<ul class="simple">
-<li>Put your work out there on the internet</li>
-<li>Think about internationalization</li>
-<li>Self publish Amazon's create space, Kindle</li>
-<li>Quizzes, collect data, data mining</li>
-<li>Instructor section</li>
-<li>Online markup of code</li>
-<li>EpicPen</li>
-<li>YouTube channel</li>
-<li>Libraries: Pygame, Arcade</li>
-</ul>
-</div>
-<div class="section" id="pyzero">
-<h2>Pyzero</h2>
-<ul class="simple">
-<li>Demos</li>
-<li>pzrun</li>
-</ul>
-</div>
-<div class="section" id="minecraft-with-python">
-<h2>Minecraft with Python</h2>
-<ul class="simple">
-<li>Use Python to interact with Minecraft</li>
-<li>CoderDojo Minecraft bundle</li>
-<li>Using Jupyter Notebooks</li>
-</ul>
-</div>
-<div class="section" id="pycharm-edu">
-<h2>PyCharm Edu</h2>
-<ul class="simple">
-<li>Courses</li>
-<li>Checkout PyCharm EDU for creating courses</li>
-</ul>
-</div>
-<div class="section" id="teaching-data-structures-with-python">
-<h2>Teaching data structures with Python</h2>
-<ul class="simple">
-<li>Python makes the teacher happy</li>
-<li>Lab only</li>
-<li>Algorithms in Python + C (Side by side)</li>
-<li>Two languages worked well for them.</li>
-<li>Low level language: easy to find the complexity of the algorithm</li>
-<li>High level language: hard to find the complexity of the algorithm</li>
-</ul>
-</div>
-<div class="section" id="merlin-for-data-science-education">
-<h2>Merlin for Data Science Education</h2>
-<ul class="simple">
-<li>Where to even start?</li>
-<li>Effort justification</li>
-<li>Spending 2hr out of a 8hr session in fixing something is not worth it</li>
-<li>Shouldn't be proud of battling with tool set rather than not doing the real work</li>
-<li>Merlin - <a class="reference external" href="http://www.darklabsdatascience.com/project_merlin/">http://www.darklabsdatascience.com/project_merlin/</a></li>
-</ul>
-</div>
-PyCon Education Summit Talk2016-05-26T11:27:00+10:002016-05-26T11:27:00+10:00Amit Sahatag:doingmathwithpython.github.io,2016-05-26:/pycon-edu-summit-talk.html<p class="first last">PyCon education summit talk</p>
-<p>Hi everyone, I have uploaded the <a class="reference external" href="https://doingmathwithpython.github.io/pycon-us-2016/">slides</a> for my upcoming talk at the PyCon Education Summit. If you are coming to the talk, feel free to have a look at the slides and have any questions/comments ready for me.</p>
-<p>The slides are made using Jupyter Notebook + nbconvert magic. Thank you to everyone who makes these things happen. You can see the slides notebook <a class="reference external" href="https://github.com/doingmathwithpython/pycon-us-2016">here</a>.</p>
-<p>As a PyCon special, No Starch Press has setup a discount code <tt class="docutils literal">PYCONMATH</tt> code which will give you 30 % off my book, <a class="reference external" href="https://www.nostarch.com/doingmathwithpython">Doing Math with Python</a> and is valid from May 26th - June 8th.</p>
-SymPy 1.0 and Anaconda 4.0 releases2016-04-11T19:50:00+10:002016-04-11T19:50:00+10:00Amit Sahatag:doingmathwithpython.github.io,2016-04-11:/sympy-1.0-anaconda-4.0.html<p class="first last">sympy 1.0 and Anaconda 4.0</p>
-<p><a class="reference external" href="http://sympy.org">SymPy 1.0</a> was released recently and <a class="reference external" href="https://www.continuum.io/blog/developer-blog/anaconda-4-release">Anaconda 4.0</a>
-was just released. I tried all the <a class="reference external" href="http://doingmathwithpython.github.io/trying-out-solutions.html">sample solutions</a>
-and everything works as expected. The <a class="reference external" href="http://doingmathwithpython.github.io/pages/programs.html">chapter programs</a> should
-keep working as well.</p>
-<p>You can get both the updates when you install Anaconda 4.0 or updated
-your existing Anaconda installation:</p>
-<pre class="code literal-block">
-$ conda update conda
-$ conda update anaconda
-</pre>
-<p>I have so far verified both on Mac OS X and Linux. If you find any
-issues on Windows, please email me at
-<tt class="docutils literal">doingmathwithpython@gmail.com</tt> or post your query/tip to any of the
-following community forums:</p>
-<ul class="simple">
-<li><a class="reference external" href="https://www.facebook.com/doingmathwithpython">Facebook page</a></li>
-<li><a class="reference external" href="https://plus.google.com/u/0/communities/113121562865298236232">G+ Community</a></li>
-</ul>
-What readers are saying2016-02-14T10:00:00+10:002016-02-14T10:00:00+10:00Amit Sahatag:doingmathwithpython.github.io,2016-02-14:/what-readers-are-saying.html<p class="first last">Reviews of Doing Math with Python</p>
-<p>Readers have shared how they are finding <em>Doing Math with Python</em> by
-posting reviews on Amazon and their own blog. You can view all of them
-on the <a class="reference external" href="http://doingmathwithpython.github.io/pages/reviews.html">Reviews</a> page.</p>
-<p>Some readers have also been kind enough to let me know personally how the book
-has helped them to restart their programming, or looking at something
-they have been putting off. As the author, I think this is the highest
-level of appreciation that I could have hoped for.</p>
-<p>Recently, Aaron Meurer (the lead developer of SymPy) mentioned the
-book in an <a class="reference external" href="http://pythonpodcast.com/aaron-meurer-sympy.html">episode</a> of
-Podcast.__init__ titled "SymPy with Aaron Meurer". If you are curious
-to learn more about SymPy, I would recommend listening to it.</p>
-<p>I am curious to hear more. If you want to get in touch personally,
-please do so via any of the following channels:</p>
-<ul class="simple">
-<li><a class="reference external" href="https://www.facebook.com/doingmathwithpython">Facebook page</a></li>
-<li><a class="reference external" href="https://plus.google.com/u/0/communities/113121562865298236232">G+ Community</a></li>
-<li><a class="reference external" href="https://twitter.com/mathwithpython">Twitter</a></li>
-</ul>
-<p>You can email me at <a class="reference external" href="mailto:doingmathwithpython@gmail.com">doingmathwithpython@gmail.com</a>.</p>
-<p>Alternatively, if you just plan to write a review, please do so on
-Amazon, O'Reilly or your personal blog.</p>
-Trying out the solutions in IDLE2015-11-18T08:20:00+10:002015-11-18T08:20:00+10:00Amit Sahatag:doingmathwithpython.github.io,2015-11-18:/trying-out-solutions.html<p class="first last">Trying out the solutions</p>
-<p>Once you <a class="reference external" href="https://www.nostarch.com/download/doingmath_code.zip">download</a> the solutions ZIP file, and extract it you will
-find the solutions for each chapter in the corresponding sub-directory.</p>
-<div class="figure align-center">
-<img alt="Extracted ZIP archive" src="http://doingmathwithpython.github.io/images/zip-extracted.png" />
-</div>
-<p>The <strong>PDF</strong> file contains explanations for each of the solutions
-similar to the explanations for the programs in the book.</p>
-<p>Before you can try the programs out, you will have to open them first in IDLE.
-Let's consider the solution to a challenge posed in Chapter 6 to draw
-the Mandelbrot set - <tt class="docutils literal">mandelbrot.py</tt>. Start <tt class="docutils literal">IDLE</tt> and click on the menu item <tt class="docutils literal">File >
-Open</tt> and navigate to the location where you extracted the directory
-above and open the file <tt class="docutils literal">mandelbrot.py</tt>.</p>
-<div class="figure align-center">
-<img alt="IDLE window" src="http://doingmathwithpython.github.io/images/idle-1.png" />
-<p class="caption">Snapshot of the source code</p>
-</div>
-<div class="section" id="running-the-program">
-<h2>Running the program</h2>
-<p>To run the program, click on <tt class="docutils literal">Run > Run Module</tt> and you should see
-the Mandelbrot set in the matplotlib window.</p>
-<div class="figure align-center">
-<img alt="Mandelbrot Set" src="http://doingmathwithpython.github.io/images/idle-2.png" />
-<p class="caption">Mandelbrot set</p>
-</div>
-<p>All the solutions should be ready to run, try them out, make changes
-to experiment and let me know what you come up with!</p>
-<p>Email me at <tt class="docutils literal">doingmathwithpython@gmail.com</tt> or post your query/tip to any of the
-following community forums:</p>
-<ul class="simple">
-<li><a class="reference external" href="https://www.facebook.com/doingmathwithpython">Facebook page</a></li>
-<li><a class="reference external" href="https://plus.google.com/u/0/communities/113121562865298236232">G+ Community</a></li>
-</ul>
-</div>
-Breaking long lines in Python2015-11-04T12:00:00+10:002015-11-04T12:00:00+10:00Amit Sahatag:doingmathwithpython.github.io,2015-11-04:/breaking-long-lines-in-python.html<p class="first last">Breaking long lines in Python</p>
-<p>In some of the programs discussed in the book including the sample solutions, you will see statements like:</p>
-<pre class="code literal-block">
-print('Area: {0}, Estimated ({1}): {2}'.
- format(area_of_circle, points, estimate(radius, points)))
-</pre>
-<p>This is really the following single statement:</p>
-<pre class="code literal-block">
-print('Area: {0}, Estimated ({1}): {2}'.format(area_of_circle, points, estimate(radius, points)))
-</pre>
-<p>The first code snippet above is an example of breaking a long line into two (or more) lines so that we don't end up with really long lines in our code. How long should a line be when you should think about breaking it? If your statement's length is more than 80 characters, you should think about breaking it up.</p>
-<p>In the book, we often had to do so because of layout reasons even though the statement may not have exceeded 80 characters, and in your projects you will want to do it so that your statements are easier to read and on the average all lines have a similar length. This is formalized (among other things) in <a class="reference external" href="https://www.python.org/dev/peps/pep-0008/">PEP 8</a>.</p>
-<p>Note that the examples below will for illustrative purposes break lines waaaaay less than 80 characters.</p>
-<div class="section" id="how-do-you-break">
-<h2>How do you break?</h2>
-<div class="section" id="when-not-calling-function">
-<h3>When not calling function</h3>
-<p>When you are not calling a function, you essentially have two choices:</p>
-<p><strong>Use paranthesis</strong></p>
-<p>This is exactly how we break the long statement in the example we started this article with. For the moment ignore the call to <tt class="docutils literal">print()</tt> and assume that the statement is:</p>
-<pre class="code literal-block">
-s = 'Area: {0}, Estimated ({1}): {2}'.format(area_of_circle, points, estimate(radius, points))
-</pre>
-<p>This essentially just creates the string <tt class="docutils literal">s</tt>. If we were to split this statement over multiple lines, we would do the following:</p>
-<pre class="code literal-block">
-s = ('Area: {0}, Estimated ({1}): {2}'
- .format(area_of_circle, points, estimate(radius, points)))
-</pre>
-<p>Note the extra beginning and the ending parenthesis.</p>
-<p>Here is another example:</p>
-<pre class="code literal-block">
-s1 = x + x**2/2 + x**3/3 + x**4/4 + x**5/5 + x**6/6 + x**7/7 + x**8/8
-</pre>
-<p>Here is how we can use split the above statment into multiple lines using parentheses:</p>
-<pre class="code literal-block">
-s3 = (x + x**2/2 + x**3/3
- + x**4/4 + x**5/5
- + x**6/6 + x**7/7
- + x**8/8)
-</pre>
-<p><strong>Use the line continuation operator</strong></p>
-<p>The line continuation operator, <tt class="docutils literal">\</tt> can be used to split long statements over multiple lines. Here is how we could split the above statement using <tt class="docutils literal">\</tt> instead:</p>
-<pre class="code literal-block">
-s3 = x + x**2/2 + x**3/3 \
- + x**4/4 + x**5/5 \
- + x**6/6 + x**7/7 \
- + x**8/8
-</pre>
-<p>At the end of every line (except the last), we just add a <tt class="docutils literal">\</tt> indicating that the next line is also a part of the same statement.</p>
-<p><strong>Breaking up those long if statements</strong></p>
-<p>Often I have to break long <tt class="docutils literal">if</tt> statements and is in fact one of the most common cases I face at work where I have to break the statement into multiple lines. Here is an example using both the approaches above:</p>
-<pre class="code literal-block">
-# Using parenthesis
-if (cond1 and cond2 and cond3
- and cond4):
- # True block
-else:
- # False block
-
-# Using line continuation operator
-if cond1 and cond2 and cond3 \
- and cond4:
- # True block
-else:
- # False block
-</pre>
-</div>
-<div class="section" id="when-calling-functions">
-<h3>When calling functions</h3>
-<p>By default, when calling functions you can just press enter and without doing anything more keep writing your statement over multiple lines. For example:</p>
-<pre class="code literal-block">
-x = 1
-print(x,
- x)
-</pre>
-<p>Hence, we <cite>could</cite> have broken the first example we saw as:</p>
-<pre class="code literal-block">
-print('Area: {0}, Estimated ({1}): {2}'.format(area_of_circle,
- points,
- estimate(radius, points)))
-</pre>
-<p>When calling <tt class="docutils literal">format()</tt> we put the arguments over separate lines.</p>
-</div>
-</div>
-<div class="section" id="learning-more-about-python-coding-style">
-<h2>Learning more about Python coding style</h2>
-<p>If you liked reading this article, you may also find it worth your time going over the <a class="reference external" href="https://www.python.org/dev/peps/pep-0008/">Python style guide</a>. You may even find instances where I have not followed a guideline when writing the programs in the book. If you find one, let me know.</p>
-</div>
-<div class="section" id="getting-in-touch">
-<h2>Getting in touch</h2>
-<p>Stay updated or get in touch:</p>
-<ul class="simple">
-<li><a class="reference external" href="https://www.facebook.com/doingmathwithpython">Facebook page</a></li>
-<li><a class="reference external" href="https://plus.google.com/u/0/communities/113121562865298236232">G+ Community</a></li>
-<li><a class="reference external" href="https://twitter.com/mathwithpython">Twitter</a></li>
-</ul>
-<p>You can contact me directly via:</p>
-<ul class="simple">
-<li>Twitter: <a class="reference external" href="https://twitter.com/mathwithpython">@mathwithpython</a></li>
-<li>Email : <a class="reference external" href="mailto:doingmathwithpython@gmail.com">doingmathwithpython@gmail.com</a></li>
-</ul>
-</div>
-Chapter code and Errata2015-09-11T08:20:00+10:002015-09-11T08:20:00+10:00Amit Sahatag:doingmathwithpython.github.io,2015-09-11:/chapter-code-errata.html<p class="first last">Chapter code and errata</p>
-<p>You can find the chapter programs and snippets linked from the <a class="reference external" href="http://doingmathwithpython.github.io/pages/programs.html">programs</a> page. They should be free
-from any error mentioned on the <a class="reference external" href="http://doingmathwithpython.github.io/pages/errata.html">errata</a> page.</p>
-<div class="section" id="stay-in-touch">
-<h2>Stay in touch</h2>
-<p>You can stay connected with the book, its readers and me via the
-following channels:</p>
-<ul class="simple">
-<li><a class="reference external" href="https://www.facebook.com/doingmathwithpython">Facebook page</a></li>
-<li><a class="reference external" href="https://plus.google.com/u/0/communities/113121562865298236232">G+ Community</a></li>
-<li><a class="reference external" href="https://twitter.com/mathwithpython">Twitter</a></li>
-</ul>
-<p>You can contact me directly via:</p>
-<ul class="simple">
-<li>Twitter: <a class="reference external" href="https://twitter.com/mathwithpython">@mathwithpython</a></li>
-<li>Email : <a class="reference external" href="mailto:doingmathwithpython@gmail.com">doingmathwithpython@gmail.com</a></li>
-</ul>
-</div>
-Set operations with Python set compared to SymPy's FiniteSet2015-09-05T23:00:00+10:002015-09-05T23:00:00+10:00Amit Sahatag:doingmathwithpython.github.io,2015-09-05:/Sets-in-SymPy-and-built-in-Python-sets.html<p class="first last">Sets in SymPy and built-in Python sets</p>
-<p><cite>Chapter 5</cite> (<a class="reference external" href="http://doingmathwithpython.github.io/pages/about.html">About</a>) of the book discusses working with mathematical sets in
-Python. While writing the chapter, I had a choice of whether to
-use Python 3's built-in <a class="reference external" href="https://docs.python.org/3.3/library/stdtypes.html?highlight=union#set-types-set-frozenset">set</a> data
-structure or use SymPy's (0.7.6 +) <tt class="docutils literal">FiniteSet</tt> class. I decided to go ahead
-with the latter. My choice is briefly explained towards the end of
-this post, but hopefully it will be clear before that.</p>
-<p>Next, I describe how you can use Python 3's built-in set data
-structure to create sets and perform set operations such as finding
-the union, intersection or cartesian product of sets. For comparison,
-I also show how you can do the same using SymPy's <tt class="docutils literal">FiniteSet</tt> class.</p>
-<div class="section" id="creating-a-set">
-<h2>Creating a set</h2>
-<p>We can create a set consisting of the elements <cite>{1, 2, 3}</cite> in Python 3
-as follows:</p>
-<div class="highlight"><pre><span></span><span class="o">>>></span> <span class="n">s1</span> <span class="o">=</span> <span class="p">{</span><span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> <span class="mi">3</span><span class="p">}</span>
-<span class="o">>>></span> <span class="n">s1</span>
-<span class="p">{</span><span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> <span class="mi">3</span><span class="p">}</span>
-</pre></div>
-<p>To create a set when the elements are already in a list (for
-example), we would use the following syntax:</p>
-<div class="highlight"><pre><span></span><span class="o">>>></span> <span class="n">items</span> <span class="o">=</span> <span class="p">[</span><span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> <span class="mi">3</span><span class="p">]</span>
-<span class="o">>>></span> <span class="n">s2</span> <span class="o">=</span> <span class="nb">set</span><span class="p">(</span><span class="n">items</span><span class="p">)</span>
-<span class="o">>>></span> <span class="n">s2</span>
-<span class="p">{</span><span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> <span class="mi">3</span><span class="p">}</span>
-</pre></div>
-<p>The comparative operations using SymPy's <tt class="docutils literal">FiniteSet</tt> class are:</p>
-<div class="highlight"><pre><span></span><span class="o">>>></span> <span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">FiniteSet</span>
-<span class="o">>>></span> <span class="n">s1</span> <span class="o">=</span> <span class="n">FiniteSet</span><span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> <span class="mi">3</span><span class="p">)</span>
-<span class="o">>>></span> <span class="n">s1</span>
-<span class="p">{</span><span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> <span class="mi">3</span><span class="p">}</span>
-
-<span class="o">>>></span> <span class="n">items</span> <span class="o">=</span> <span class="p">[</span><span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> <span class="mi">3</span><span class="p">]</span>
-<span class="o">>>></span> <span class="n">s2</span> <span class="o">=</span> <span class="n">FiniteSet</span><span class="p">(</span><span class="o">*</span><span class="n">items</span><span class="p">)</span>
-<span class="o">>>></span> <span class="n">s2</span>
-<span class="p">{</span><span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> <span class="mi">3</span><span class="p">}</span>
-</pre></div>
-<p>To create an <a class="reference external" href="https://en.wikipedia.org/wiki/Empty_set">empty set</a>,
-in Python 3 you would use create an empty <tt class="docutils literal">set</tt> object:</p>
-<div class="highlight"><pre><span></span><span class="o">>>></span> <span class="n">e</span> <span class="o">=</span> <span class="nb">set</span><span class="p">()</span>
-<span class="o">>>></span> <span class="n">e</span>
-<span class="nb">set</span><span class="p">()</span>
-</pre></div>
-<p>In SymPy, an empty set is represented by an <tt class="docutils literal">EmptySet</tt> object. Thus,
-you can either create an empty set by directly creating an
-<tt class="docutils literal">EmptySet</tt> object or by creating a <tt class="docutils literal">FiniteSet</tt> object without
-specifying any set members, like so:</p>
-<div class="highlight"><pre><span></span><span class="o">>>></span> <span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">EmptySet</span>
-<span class="o">>>></span> <span class="n">e</span> <span class="o">=</span> <span class="n">EmptySet</span><span class="p">()</span>
-<span class="o">>>></span> <span class="n">e</span>
-<span class="n">EmptySet</span><span class="p">()</span>
-<span class="o">>>></span> <span class="n">e</span> <span class="o">=</span> <span class="n">FiniteSet</span><span class="p">()</span>
-<span class="o">>>></span> <span class="n">e</span>
-<span class="n">EmptySet</span><span class="p">()</span>
-</pre></div>
-</div>
-<div class="section" id="cardinality-and-membership">
-<h2>Cardinality and Membership</h2>
-<p>The <tt class="docutils literal">len()</tt> function returns the number of set members for sets
-created using either of the above approaches.</p>
-<p>Similarly, to check if an item <tt class="docutils literal">x</tt> is present in a set, <tt class="docutils literal">s</tt>
-created using any of the above approaches, we can use the statement,
-<tt class="docutils literal">x in s</tt>.</p>
-</div>
-<div class="section" id="union-and-intersection">
-<h2>Union and intersection</h2>
-<p>The <tt class="docutils literal">union()</tt> method can be used in both cases to find the union of
-two or more sets:</p>
-<div class="highlight"><pre><span></span><span class="o">>>></span> <span class="n">s1</span> <span class="o">=</span> <span class="nb">set</span><span class="p">([</span><span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> <span class="mi">3</span><span class="p">])</span>
-<span class="o">>>></span> <span class="n">s2</span> <span class="o">=</span> <span class="nb">set</span><span class="p">([</span><span class="mi">2</span><span class="p">,</span> <span class="mi">3</span><span class="p">,</span> <span class="mi">4</span><span class="p">])</span>
-<span class="o">>>></span> <span class="n">s3</span> <span class="o">=</span> <span class="nb">set</span><span class="p">([</span><span class="mi">2</span><span class="p">,</span> <span class="mi">3</span><span class="p">,</span> <span class="mi">4</span><span class="p">,</span> <span class="mi">5</span><span class="p">])</span>
-<span class="o">>>></span> <span class="n">s1</span><span class="o">.</span><span class="n">union</span><span class="p">(</span><span class="n">s2</span><span class="p">)</span><span class="o">.</span><span class="n">union</span><span class="p">(</span><span class="n">s3</span><span class="p">)</span>
-<span class="p">{</span><span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> <span class="mi">3</span><span class="p">,</span> <span class="mi">4</span><span class="p">,</span> <span class="mi">5</span><span class="p">}</span>
-</pre></div>
-<p>Similary in the case of SymPy:</p>
-<div class="highlight"><pre><span></span><span class="o">>>></span> <span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">FiniteSet</span>
-<span class="o">>>></span> <span class="n">s1</span> <span class="o">=</span> <span class="n">FiniteSet</span><span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> <span class="mi">3</span><span class="p">)</span>
-<span class="o">>>></span> <span class="n">s2</span> <span class="o">=</span> <span class="n">FiniteSet</span><span class="p">(</span><span class="mi">2</span><span class="p">,</span> <span class="mi">3</span><span class="p">,</span> <span class="mi">4</span><span class="p">)</span>
-<span class="o">>>></span> <span class="n">s3</span> <span class="o">=</span> <span class="n">FiniteSet</span><span class="p">(</span><span class="mi">2</span><span class="p">,</span> <span class="mi">3</span><span class="p">,</span> <span class="mi">4</span><span class="p">,</span> <span class="mi">5</span><span class="p">)</span>
-<span class="o">>>></span> <span class="n">s1</span><span class="o">.</span><span class="n">union</span><span class="p">(</span><span class="n">s2</span><span class="p">)</span><span class="o">.</span><span class="n">union</span><span class="p">(</span><span class="n">s3</span><span class="p">)</span>
-<span class="p">{</span><span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> <span class="mi">3</span><span class="p">,</span> <span class="mi">4</span><span class="p">,</span> <span class="mi">5</span><span class="p">}</span>
-</pre></div>
-<p>The <tt class="docutils literal">intersection()</tt> method can be used to find the intersection of
-two or more sets created using either of the above approaches. Continuing
-with the above three sets:</p>
-<div class="highlight"><pre><span></span><span class="o">>>></span> <span class="n">s1</span> <span class="o">=</span> <span class="nb">set</span><span class="p">([</span><span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> <span class="mi">3</span><span class="p">])</span>
-<span class="o">>>></span> <span class="n">s2</span> <span class="o">=</span> <span class="nb">set</span><span class="p">([</span><span class="mi">2</span><span class="p">,</span> <span class="mi">3</span><span class="p">,</span> <span class="mi">4</span><span class="p">])</span>
-<span class="o">>>></span> <span class="n">s3</span> <span class="o">=</span> <span class="nb">set</span><span class="p">([</span><span class="mi">2</span><span class="p">,</span> <span class="mi">3</span><span class="p">,</span> <span class="mi">4</span><span class="p">,</span> <span class="mi">5</span><span class="p">])</span>
-<span class="o">>>></span> <span class="n">s1</span><span class="o">.</span><span class="n">intersection</span><span class="p">(</span><span class="n">s2</span><span class="p">)</span><span class="o">.</span><span class="n">intersection</span><span class="p">(</span><span class="n">s3</span><span class="p">)</span>
-<span class="p">{</span><span class="mi">2</span><span class="p">,</span> <span class="mi">3</span><span class="p">}</span>
-</pre></div>
-<p>Similary, in SymPy:</p>
-<div class="highlight"><pre><span></span><span class="o">>>></span> <span class="n">s1</span><span class="o">.</span><span class="n">intersection</span><span class="p">(</span><span class="n">s2</span><span class="p">)</span><span class="o">.</span><span class="n">intersection</span><span class="p">(</span><span class="n">s3</span><span class="p">)</span>
-<span class="p">{</span><span class="mi">2</span><span class="p">,</span> <span class="mi">3</span><span class="p">}</span>
-</pre></div>
-</div>
-<div class="section" id="cartesian-product">
-<h2>Cartesian product</h2>
-<p>To find the cartesian product of sets created via the built-in <tt class="docutils literal">set</tt>
-data structure, we have to use the <tt class="docutils literal">product()</tt> function in the
-<a class="reference external" href="https://docs.python.org/3/library/itertools.html#itertools.product">itertools</a>
-module:</p>
-<div class="highlight"><pre><span></span><span class="o">>>></span> <span class="n">s1</span> <span class="o">=</span> <span class="p">{</span><span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> <span class="mi">3</span><span class="p">}</span>
-<span class="o">>>></span> <span class="n">s2</span> <span class="o">=</span> <span class="p">{</span><span class="mi">4</span><span class="p">,</span> <span class="mi">5</span><span class="p">,</span> <span class="mi">6</span><span class="p">}</span>
-<span class="o">>>></span> <span class="kn">import</span> <span class="nn">itertools</span>
-<span class="o">>>></span> <span class="n">itertools</span><span class="o">.</span><span class="n">product</span><span class="p">(</span><span class="n">s1</span><span class="p">,</span> <span class="n">s2</span><span class="p">)</span>
-<span class="o"><</span><span class="n">itertools</span><span class="o">.</span><span class="n">product</span> <span class="nb">object</span> <span class="n">at</span> <span class="mh">0x10418c990</span><span class="o">></span>
-</pre></div>
-<p>However considering that the <cite>cartesian product</cite> of two sets <a class="reference external" href="http://mathinsight.org/definition/cartesian_product">should</a> be another set,
-the <tt class="docutils literal">product()</tt> function doesn't really then return the
-cartesian product itself, but (an iterator to) the elements in it. Hence, if we
-try to apply the result returned by the function directly to a method or
-function which is expected to be applicable to a set, it will fail. For
-example, <tt class="docutils literal">itertools.product(s1, <span class="pre">s2).union(s3)</span></tt> will result in an error, but
-<tt class="docutils literal">set(itertools.product(s1, <span class="pre">s2)).union(s3)</span></tt> will work.</p>
-<p>Using SymPy's <tt class="docutils literal">FiniteSet</tt>, you can use the <tt class="docutils literal">*</tt>
-(multiplication or product) operator to find the cartesian product
-and the result is a set itself. Thus, it is closer to what
-a cartesian product is mathematically. An example follows:</p>
-<div class="highlight"><pre><span></span><span class="o">>>></span> <span class="n">s1</span> <span class="o">=</span> <span class="n">FiniteSet</span><span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> <span class="mi">3</span><span class="p">)</span>
-<span class="o">>>></span> <span class="n">s2</span> <span class="o">=</span> <span class="n">FiniteSet</span><span class="p">(</span><span class="mi">4</span><span class="p">,</span> <span class="mi">5</span><span class="p">,</span> <span class="mi">6</span><span class="p">)</span>
-<span class="o">>>></span> <span class="o">>>></span> <span class="n">s3</span> <span class="o">=</span> <span class="n">FiniteSet</span><span class="p">(</span><span class="mi">7</span><span class="p">,</span> <span class="mi">8</span><span class="p">,</span> <span class="mi">9</span><span class="p">)</span>
-<span class="o">>>></span> <span class="p">(</span><span class="n">s1</span><span class="o">*</span><span class="n">s2</span><span class="p">)</span><span class="o">.</span><span class="n">union</span><span class="p">(</span><span class="n">s3</span><span class="p">)</span>
-<span class="p">{</span><span class="mi">7</span><span class="p">,</span> <span class="mi">8</span><span class="p">,</span> <span class="mi">9</span><span class="p">}</span> <span class="n">U</span> <span class="p">{</span><span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> <span class="mi">3</span><span class="p">}</span> <span class="n">x</span> <span class="p">{</span><span class="mi">4</span><span class="p">,</span> <span class="mi">5</span><span class="p">,</span> <span class="mi">6</span><span class="p">}</span>
-</pre></div>
-<p><strong>Cartesian product of a set with itself</strong></p>
-<p>To find the cartesian product of a set with itself, i.e. <cite>s1*s1</cite> for
-example, we pass in a keyword argument, <tt class="docutils literal">repeat</tt> while calling the
-<tt class="docutils literal">itertools.product()</tt> function. The value of <tt class="docutils literal">repeat</tt> is the
-<cite>power</cite> we want to raise the set to. Thus, <tt class="docutils literal">itertools.product(s1,
-repeat=2)</tt> will calculate the cartesian product, <cite>s1*s1</cite>:</p>
-<div class="highlight"><pre><span></span><span class="o">>>></span> <span class="n">s1</span> <span class="o">=</span> <span class="p">{</span><span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> <span class="mi">3</span><span class="p">}</span>
-<span class="o">>>></span> <span class="nb">set</span><span class="p">(</span><span class="n">itertools</span><span class="o">.</span><span class="n">product</span><span class="p">(</span><span class="n">s1</span><span class="p">,</span> <span class="n">repeat</span><span class="o">=</span><span class="mi">2</span><span class="p">))</span>
-<span class="p">{(</span><span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">),</span> <span class="p">(</span><span class="mi">3</span><span class="p">,</span> <span class="mi">2</span><span class="p">),</span> <span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="mi">3</span><span class="p">),</span> <span class="p">(</span><span class="mi">3</span><span class="p">,</span> <span class="mi">3</span><span class="p">),</span> <span class="p">(</span><span class="mi">3</span><span class="p">,</span> <span class="mi">1</span><span class="p">),</span> <span class="p">(</span><span class="mi">2</span><span class="p">,</span> <span class="mi">1</span><span class="p">),</span> <span class="p">(</span><span class="mi">2</span><span class="p">,</span> <span class="mi">3</span><span class="p">),</span> <span class="p">(</span><span class="mi">2</span><span class="p">,</span> <span class="mi">2</span><span class="p">),</span> <span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="mi">1</span><span class="p">)}</span>
-</pre></div>
-<p>In SymPy, the <tt class="docutils literal">**</tt> operator can be used for finding the cartesian
-product of a set with itself:</p>
-<div class="highlight"><pre><span></span><span class="o">>>></span> <span class="n">s1</span> <span class="o">=</span> <span class="n">FiniteSet</span><span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> <span class="mi">3</span><span class="p">)</span>
-<span class="o">>>></span> <span class="n">s1</span><span class="o">**</span><span class="mi">2</span>
-<span class="p">{</span><span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> <span class="mi">3</span><span class="p">}</span> <span class="n">x</span> <span class="p">{</span><span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> <span class="mi">3</span><span class="p">}</span>
-</pre></div>
-</div>
-<div class="section" id="subset-super-set-proper-subset-checking">
-<h2>Subset/super set/proper subset checking</h2>
-<p>The <tt class="docutils literal">issubset()</tt> and <tt class="docutils literal">issuperset()</tt> methods are available for sets
-created via either approaches to check if a set is a subset and super
-set of another, respectively. Thus, <tt class="docutils literal">s1.issubset(s2)</tt> will check if
-<cite>s1</cite> is a subset of <cite>s2</cite>.</p>
-<p><strong>Checking for proper subset and superset</strong></p>
-<p>To check if a set, <cite>s1</cite> is a <a class="reference external" href="http://mathworld.wolfram.com/ProperSubset.html">proper subset</a> of another set,
-<cite>s2</cite> when using built-in set, we can do the following:</p>
-<div class="highlight"><pre><span></span><span class="o">>>></span> <span class="n">s1</span> <span class="o">=</span> <span class="p">{</span><span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> <span class="mi">3</span><span class="p">}</span>
-<span class="o">>>></span> <span class="n">s2</span> <span class="o">=</span> <span class="p">{</span><span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> <span class="mi">3</span><span class="p">,</span> <span class="mi">4</span><span class="p">}</span>
-<span class="o">>>></span> <span class="n">s1</span><span class="o">.</span><span class="n">issubset</span><span class="p">(</span><span class="n">s2</span><span class="p">)</span> <span class="ow">and</span> <span class="n">s1</span> <span class="o">!=</span> <span class="n">s2</span>
-<span class="kc">True</span>
-</pre></div>
-<p>We can do something similar for <a class="reference external" href="http://mathinsight.org/definition/proper_superset">proper superset</a>.</p>
-<p>In SymPy, we have <tt class="docutils literal">is_proper_subset()</tt> and <tt class="docutils literal">is_proper_superset()</tt>
-methods which can be used to check if a set is a proper subset or
-superset of another, respectively. Thus, the above would be written as
-<tt class="docutils literal">s1.is_proper_subset(s2)</tt>.</p>
-</div>
-<div class="section" id="calculating-the-powerset">
-<h2>Calculating the powerset</h2>
-<p>For sets created via built-in <tt class="docutils literal">set</tt> data structure, there is no
-direct method available to create the <a class="reference external" href="https://www.mathsisfun.com/sets/power-set.html">power set</a>. However, you can use the
-<tt class="docutils literal">powerset</tt> recipe described in the <a class="reference external" href="https://docs.python.org/3/library/itertools.html#recipes">itertools documentation</a>.</p>
-<p>On the other hand, in SymPy, there is a <tt class="docutils literal">powerset()</tt> method
-available which returns the power set:</p>
-<div class="highlight"><pre><span></span><span class="o">>>></span> <span class="n">s1</span> <span class="o">=</span> <span class="n">FiniteSet</span><span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> <span class="mi">3</span><span class="p">)</span>
-<span class="o">>>></span> <span class="n">s1</span><span class="o">.</span><span class="n">powerset</span><span class="p">()</span>
-<span class="p">{</span><span class="n">EmptySet</span><span class="p">(),</span> <span class="p">{</span><span class="mi">1</span><span class="p">},</span> <span class="p">{</span><span class="mi">2</span><span class="p">},</span> <span class="p">{</span><span class="mi">3</span><span class="p">},</span> <span class="p">{</span><span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">},</span> <span class="p">{</span><span class="mi">1</span><span class="p">,</span> <span class="mi">3</span><span class="p">},</span> <span class="p">{</span><span class="mi">2</span><span class="p">,</span> <span class="mi">3</span><span class="p">},</span> <span class="p">{</span><span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> <span class="mi">3</span><span class="p">}}</span>
-</pre></div>
-<p>You can see that the <tt class="docutils literal">powerset()</tt> method returns the power <cite>set</cite> and not the
-elements in it.</p>
-</div>
-<div class="section" id="choice-of-sympy-s-finiteset-over-set">
-<h2>Choice of SymPy's <tt class="docutils literal">FiniteSet</tt> over <tt class="docutils literal">set</tt></h2>
-<p>From the above comparison, we can see that SymPy's <tt class="docutils literal">FiniteSet</tt>
-provides us with nice features such as being able to use the <tt class="docutils literal">*</tt>
-operator to find the cartesian product, <tt class="docutils literal">**</tt> operator to calculate
-the cartesian product with itself and <tt class="docutils literal">powerset()</tt> method for calculating the
-power set. These are not present when using the built-in <tt class="docutils literal">set</tt> data
-structure. This was certainly a big driving factor in my choice,
-since SymPy was also being used in other chapters of the book.</p>
-<p>However, a <em>key</em> reason for my choice was that I wanted to show how we
-can create sets which did not allow addition or removal once created -
-like mathematical sets. This need was fulfilled by SymPy's
-<tt class="docutils literal">FiniteSet</tt> since it used Python's <tt class="docutils literal">frozenset</tt> data structure and
-not the <tt class="docutils literal">set</tt> data sturcture.</p>
-<p>The alternative to that would have
-been to use <tt class="docutils literal">frozenset</tt> directly, but I just did not like the idea
-of it and I would have also missed out on the nice features
-<tt class="docutils literal">FiniteSet</tt> would provide (eventually). I should note here that once
-I had made the decision to go with <tt class="docutils literal">FiniteSet</tt>, I <a class="reference external" href="https://github.com/amitsaha/sympy/commits?author=amitsaha">contributed</a> patches
-to SymPy to make the methods of <tt class="docutils literal">FiniteSet</tt> more compatible with Python's built in set
-and also implement minor features I discussed above.</p>
-</div>
-Doing Math with Python Available now!2015-09-02T08:00:00+10:002015-09-02T08:00:00+10:00Amit Sahatag:doingmathwithpython.github.io,2015-09-02:/available-now.html<p class="first last">Available now!</p>
-<p>Hi all, I am very excited to announce that the book is now available for
-purchase in print and electronic formats from various online stores
-including <a class="reference external" href="http://www.amazon.com/Doing-Math-Python-Programming-Statistics/dp/1593276400">Amazon</a>
-and <a class="reference external" href="https://www.nostarch.com/doingmathwithpython">No Starch Press</a>.
-Please see the <a class="reference external" href="http://doingmathwithpython.github.io/pages/buy.html">Buy</a> page for others.</p>
-<a class="reference external image-reference" href="http://www.nostarch.com/doingmathwithpython"><img alt="Book cover" class="align-center" src="http://doingmathwithpython.github.io/images/cover.png" /></a>
-<p>If you are keen to take a look at the contents and read a sample
-chapter, please head over to <a class="reference external" href="https://www.nostarch.com/doingmathwithpython">No Starch's book page</a>.</p>
-<p>Alternatively, if you are keen to recieve a review copy, please email
-<cite>doingmathwithpython@gmail.com</cite> and I will try to request one from the
-publishers.</p>
-<div class="section" id="stay-in-touch">
-<h2>Stay in touch</h2>
-<p>You can stay connected with the book, its readers and me via the
-following channels:</p>
-<ul class="simple">
-<li><a class="reference external" href="https://www.facebook.com/doingmathwithpython">Facebook page</a></li>
-<li><a class="reference external" href="https://plus.google.com/u/0/communities/113121562865298236232">G+ Community</a></li>
-<li><a class="reference external" href="https://twitter.com/mathwithpython">Twitter</a></li>
-</ul>
-<p>You can contact me directly via:</p>
-<ul class="simple">
-<li>Twitter: <a class="reference external" href="https://twitter.com/mathwithpython">@mathwithpython</a></li>
-<li>Email : <a class="reference external" href="mailto:doingmathwithpython@gmail.com">doingmathwithpython@gmail.com</a></li>
-</ul>
-</div>
-All chapters completed, off to the printers2015-08-15T23:27:00+10:002015-08-15T23:27:00+10:00Amit Sahatag:doingmathwithpython.github.io,2015-08-15:/off-to-printers.html<p class="first last">off to printers!</p>
-<p>I am very excited to write that all the chapters has been completed
-and the book is currently with the printers! You can find out more
-about the contents (including a detailed table of contents) from the
-<a class="reference external" href="http://doingmathwithpython.github.io/pages/about.html">About</a> page.</p>
-<p>You can stay connected with the book, its readers and me via the
-following channels:</p>
-<ul class="simple">
-<li><a class="reference external" href="https://www.facebook.com/doingmathwithpython">Facebook page</a></li>
-<li><a class="reference external" href="https://plus.google.com/u/0/communities/113121562865298236232">G+ Community</a></li>
-<li><a class="reference external" href="https://twitter.com/mathwithpython">Twitter</a></li>
-</ul>
-Introduction to "Doing Math with Python"2015-05-24T23:27:00+10:002015-05-24T23:27:00+10:00Amit Sahatag:doingmathwithpython.github.io,2015-05-24:/hello-world.html<p class="first last">Hello World</p>
-<p>Hi all, this is the blog for my book "Doing Math with Python".</p>
-<a class="reference external image-reference" href="http://www.nostarch.com/doingmathwithpython"><img alt="Book cover" class="align-center" src="http://doingmathwithpython.github.io/images/cover.png" /></a>
-<p>The first six chapters of the book are already available via the
-publisher's early access program. You can learn briefly about each
-chapter on the <a class="reference external" href="http://doingmathwithpython.github.io/pages/about.html">About</a> page.
-Going forward, I will be sharing updates regarding the book and posting
-original content related to that discussed in the book.</p>
-<p>You can stay connected with the book, its readers and me via the
-following channels:</p>
-<ul class="simple">
-<li><a class="reference external" href="https://www.facebook.com/doingmathwithpython">Facebook page</a></li>
-<li><a class="reference external" href="https://plus.google.com/u/0/communities/113121562865298236232">G+ Community</a></li>
-<li><a class="reference external" href="https://twitter.com/mathwithpython">Twitter</a></li>
-</ul>
-
\ No newline at end of file
diff --git a/feeds/all.atom.xml b/feeds/all.atom.xml
deleted file mode 100644
index b405168..0000000
--- a/feeds/all.atom.xml
+++ /dev/null
@@ -1,855 +0,0 @@
-
-Doing Math with Pythonhttp://doingmathwithpython.github.io/2023-10-25T13:20:00+10:00Doing Math with Python in Data Science Humble Bundle2023-10-25T13:20:00+10:002023-10-25T13:20:00+10:00Amit Sahatag:doingmathwithpython.github.io,2023-10-25:/humble-bundle-data-science.html<p class="first last">Humble bundle</p>
-<p>"Doing Math with Python" is part of No Starch Press's <a class="reference external" href="https://www.humblebundle.com/books/data-science-no-starch-press-books">Data Science Humble Bundle</a>
-running for the next 19 days. Your purchases will help support EFF!</p>
-<div class="figure align-center">
-<img alt="Humble Bundle" src="http://doingmathwithpython.github.io/images/data-science-humble-bundle.png" />
-</div>
-<p>Get the bundle <a class="reference external" href="https://www.humblebundle.com/books/data-science-no-starch-press-books">here</a>!</p>
-<p>I am still surprised that the book still continues to be relevant, and i am quietly happy that I could produce such a book,
-thanks to all the help i got from No Starch folks.</p>
-Chapter 3 - Google Correlate example update2020-07-11T00:00:00+10:002020-07-11T00:00:00+10:00Amit Sahatag:doingmathwithpython.github.io,2020-07-11:/chapter-3-google-correlate-example-update.html<p>In Chapter 3 on Page 87, the book refers to the Google Correlate service. However, as of December 2019, the service has been shutdown.
-Since the chapter requires you to download a CSV formatted data, it is no longer possible. However, you can instead download a version of
-the data …</p><p>In Chapter 3 on Page 87, the book refers to the Google Correlate service. However, as of December 2019, the service has been shutdown.
-Since the chapter requires you to download a CSV formatted data, it is no longer possible. However, you can instead download a version of
-the data that I had used 5 years back when writing the book from
-<a class="reference external" href="https://github.com/doingmathwithpython/code/blob/master/chapter3/solutions/correlate-summer.csv">here</a>.</p>
-<p>Thanks to a reader for pointing me to this issue.</p>
-Coding Starter Kit Humble Bundle2020-03-17T00:00:00+10:002020-03-17T00:00:00+10:00Amit Sahatag:doingmathwithpython.github.io,2020-03-17:/humble-bundle-coding-starter.html<p>I am very excited to share that "Doing Math with Python" is part of No Starch Press's <a class="reference external" href="https://www.humblebundle.com/books/coding-starter-kit-no-starch-press-books?mc_cid=01272437d1&mc_eid=a8fa0cb420">Coding Starter Humble Bundle</a>.
-Of course, you get No Starch Press's other excellent coding books as part of the bundle.</p>
-<p>It's on for the next 20 days!</p>
-<div class="figure align-left">
-<img alt="Humble Bundle" src="http://doingmathwithpython.github.io/images/coding-starter-humble-bundle.png" />
-</div>
-<p>Your purchases will help support the …</p><p>I am very excited to share that "Doing Math with Python" is part of No Starch Press's <a class="reference external" href="https://www.humblebundle.com/books/coding-starter-kit-no-starch-press-books?mc_cid=01272437d1&mc_eid=a8fa0cb420">Coding Starter Humble Bundle</a>.
-Of course, you get No Starch Press's other excellent coding books as part of the bundle.</p>
-<p>It's on for the next 20 days!</p>
-<div class="figure align-left">
-<img alt="Humble Bundle" src="http://doingmathwithpython.github.io/images/coding-starter-humble-bundle.png" />
-</div>
-<p>Your purchases will help support the No Starch Foundation and Scratch Foundation.</p>
-<p>Get the bundle <a class="reference external" href="https://www.humblebundle.com/books/coding-starter-kit-no-starch-press-books?mc_cid=01272437d1&mc_eid=a8fa0cb420">here</a>.</p>
-Number of trailing zeros in the factorial of an integer2020-01-02T19:50:00+10:002020-01-02T19:50:00+10:00Amit Sahatag:doingmathwithpython.github.io,2020-01-02:/trailing-zeros-factorial.html<p class="first last">Use Python to find the number of trailing zeros in the factorial of an integer</p>
-<p>I recently learned about a cool formula to calculate the number of
-trailing zeros in the factorial of a number. It has been a while since I
-wrote a program to do something like this. So, I decided to change that and
-write this blog post. Let's jump in.</p>
-<p>In the spirit of wring various "calculators" in the book, we will
-write a "number of trailing zero" calculator. First up though, let's refresh
-some key relevant concepts.</p>
-<p><strong>Factorial</strong>: The factorial of a number, <tt class="docutils literal">n</tt> denoted by <tt class="docutils literal">n!</tt> is the product <tt class="docutils literal"><span class="pre">n*(n-1)*(n-2)...*1</span></tt>.
-For example, <tt class="docutils literal">5! = 5*4*3*2*1 = 120</tt>.</p>
-<p><strong>Trailing zeros</strong>: The trailing zeros of a number is the number of zeros at the end of a number. For example,
-the number 567100 has <strong>two</strong> trailing zeros.</p>
-<p><strong>Floor</strong>: The floor of a number is the greatest integer less than or equal to x. That is floor of 3.2 is 3
-and that of 3.5 is 3 and the floor of 3 is 3 as well.</p>
-<p>Now, coming back to the focus of this post, this document at brilliant.org wiki
-explains the process in <a class="reference external" href="https://brilliant.org/wiki/trailing-number-of-zeros/">detail</a>.</p>
-<p>The key bit there in is this formula:</p>
-<div class="figure">
-<img alt="" src="http://doingmathwithpython.github.io/images/trailing_zeros_formula.png" />
-</div>
-<p>where, <tt class="docutils literal">n</tt> is the number for whose factorial we want to find the number of trailing zeros.</p>
-<p>The following Python program implements the above formula:</p>
-<pre class="code literal-block">
-import math
-
-
-def is_positive_integer(x):
- try:
- x = float(x)
- except ValueError:
- return False
- else:
- if x.is_integer() and x > 0:
- return True
- else:
- return False
-
-
-def trailing_zeros(num):
- if is_positive_integer(num):
- # The above function call has done all the sanity checks for us
- # so we can just convert this into an integer here
- num = int(num)
-
- k = math.floor(math.log(num, 5))
- zeros = 0
- for i in range(1, k + 1):
- zeros = zeros + math.floor(num/math.pow(5, i))
- return zeros
- else:
- print("Factorial of a non-positive non-integer is undefined")
-
-
-if __name__ == "__main__":
- fact_num = input(
- "Enter the number whose factorial's trailing zeros you want to find: "
- )
- num_zeros = trailing_zeros(fact_num)
- print("Number of trailing zeros: {0}".format(num_zeros))
-</pre>
-<p>When we run this program using Python 3, it will ask for the number whose factorial's number of trailing
-zeros we want to find and then print it out, like so:</p>
-<pre class="code literal-block">
-Enter the number whose factorial's trailing zeros you want to find: 5
-Number of trailing zeros: 1
-</pre>
-<p>If you enter a number which is not a positive integer, you will get an error message:</p>
-<pre class="code literal-block">
-Enter the number whose factorial's trailing zeros you want to find: 5.1
-Factorial of a non-positive integer is undefined
-Number of trailing zeros: None
-</pre>
-<p>Some key standard library functions we use in the above program are:</p>
-<ul class="simple">
-<li><tt class="docutils literal">math.floor</tt>: This function is used to find the floor of a number</li>
-<li><tt class="docutils literal">math.log</tt>: This function is used to find the logarithm of a number for a specified base (defaults to 10)</li>
-<li><tt class="docutils literal">math.pow</tt>: This function is used to find out the power of a number raised to another</li>
-</ul>
-<p>The above functions are defined in the <a class="reference external" href="https://docs.python.org/3/library/math.html">math module</a>.</p>
-<p>Besides the above, we use the <cite>is_integer()</cite> function defined on a floating point object to check
-if the floating point object is actually an integer.</p>
-<p>The latest version of the code is available <a class="reference external" href="https://github.com/doingmathwithpython/code/blob/master/explorations/trailing_zeros/trailing_zeros.py">here</a>.</p>
-Doing Math with Python in Python Humble Bundle2019-08-23T00:00:00+10:002019-08-23T00:00:00+10:00Amit Sahatag:doingmathwithpython.github.io,2019-08-23:/humble-bundle-python.html<p class="first last">Humble bundle Python</p>
-<p>"Doing Math with Python" is part of No Starch Press's <a class="reference external" href="https://www.humblebundle.com/books/python-programming-no-starch-books">Python Humble Bundle</a>.
-Of course, you get No Starch Press's other excellent Python books as part of the bundle. It's still on for the next 10 days!</p>
-<div class="figure align-left">
-<img alt="Humble Bundle" src="http://doingmathwithpython.github.io/images/python-humble-bundle.png" />
-</div>
-<p>Your purchases will help support the No Starch Foundation and Python Software Foundation.</p>
-<p>Get the bundle <a class="reference external" href="https://www.humblebundle.com/books/python-programming-no-starch-books">here</a>.</p>
-Doing Math with Python in Coder's Bookshelf Humble Bundle2019-03-29T00:00:00+10:002019-03-29T00:00:00+10:00Amit Sahatag:doingmathwithpython.github.io,2019-03-29:/humble-bundle-coders-bookshelf.html<p class="first last">Humble bundle</p>
-<p>"Doing Math with Python" is part of No Starch Press's "Pay what you want" <a class="reference external" href="https://www.humblebundle.com/books/coders-bookshelf-books">Coder's Bookshelf Bundle</a>.
-Your purchases will help support a charity of your choice.</p>
-<div class="figure align-center">
-<img alt="Humble Bundle" src="http://doingmathwithpython.github.io/images/humble-bundle-3.png" />
-</div>
-<p>Get the bundle <a class="reference external" href="https://www.humblebundle.com/books/coders-bookshelf-books">here</a>!</p>
-Doing Math with Python in Linux Geek Humble Bundle2018-07-24T13:20:00+10:002018-07-24T13:20:00+10:00Amit Sahatag:doingmathwithpython.github.io,2018-07-24:/humble-bundle-linux-geek.html<p class="first last">Humble bundle</p>
-<p>"Doing Math with Python" is part of No Starch Press's "Pay what you want" <a class="reference external" href="https://www.humblebundle.com/books/linux-geek-books">Linux Geek Humble Bundle</a>
-running for the next 7 days. Your purchases will help support EFF or a charity of your choice.</p>
-<div class="figure align-center">
-<img alt="Humble Bundle" src="http://doingmathwithpython.github.io/images/humble-bundle-2.png" />
-</div>
-<p>Get the bundle <a class="reference external" href="https://www.humblebundle.com/books/linux-geek-books">here</a>!</p>
-Anaconda 5.0 release2017-10-29T19:50:00+10:002017-10-29T19:50:00+10:00Amit Sahatag:doingmathwithpython.github.io,2017-10-29:/anaconda-5.0.html<p class="first last">Anaconda 5.0 release</p>
-<p><a class="reference external" href="https://www.anaconda.com/blog/developer-blog/announcing-the-release-of-anaconda-distribution-5-0/">Anaconda 5.0</a>
-was released a few days back. I tried all the <a class="reference external" href="http://doingmathwithpython.github.io/trying-out-solutions.html">sample solutions</a>
-and everything works as expected. The <a class="reference external" href="http://doingmathwithpython.github.io/pages/programs.html">chapter programs</a> should
-keep working as well.</p>
-<p>The versions of the relevant software in this release are:</p>
-<ul class="simple">
-<li>Python 3.6</li>
-<li>sympy 1.1.1</li>
-<li>matplotlib 2.1.0</li>
-</ul>
-<p>You can update your existing installation using:</p>
-<pre class="code literal-block">
-$ conda update conda
-$ conda install anaconda=5.0
-</pre>
-<p>(Thanks to Dan Wolfe for informing me of the incorrect command to install <cite>anaconda=5.0</cite>)</p>
-<p>A fresh installation of Anaconda 5.0 should still be similar to the <a class="reference external" href="https://doingmathwithpython.github.io/pages/software-installation.html">instructions</a>
-for earlier versions.</p>
-<div class="figure align-center">
-<img alt="Anaconda 5" src="http://doingmathwithpython.github.io/images/anaconda-5.png" />
-</div>
-<div class="figure align-center">
-<img alt="Anaconda 5" src="http://doingmathwithpython.github.io/images/anaconda-install-1.png" />
-</div>
-<div class="figure align-center">
-<img alt="Anaconda 5" src="http://doingmathwithpython.github.io/images/anaconda-install-2.png" />
-</div>
-<div class="figure align-center">
-<img alt="Anaconda 5" src="http://doingmathwithpython.github.io/images/anaconda-install-3.png" />
-</div>
-<p>I have so far verified both on Mac OS X and Linux. If you find any
-issues on Windows, please email me at
-<tt class="docutils literal">doingmathwithpython@gmail.com</tt> or post your query/tip to any of the
-following community forums:</p>
-<ul class="simple">
-<li><a class="reference external" href="https://www.facebook.com/doingmathwithpython">Facebook page</a></li>
-<li><a class="reference external" href="https://plus.google.com/u/0/communities/113121562865298236232">G+ Community</a></li>
-</ul>
-Doing Math with Python Humble Bundle2017-04-06T08:20:00+10:002017-04-06T08:20:00+10:00Amit Sahatag:doingmathwithpython.github.io,2017-04-06:/humble-bundle.html<p class="first last">Humble bundle</p>
-<p>No Starch Press has launched a "Pay what you want" <a class="reference external" href="https://www.humblebundle.com/books/python-book-bundle">Python Humble Bundle</a> running from April 5th - April 19th!
-Your purchases will help support the Python Software Foundation and I am excited to announce that Doing Math with Python is part of it.</p>
-<div class="figure align-center">
-<img alt="Humble Bundle" src="http://doingmathwithpython.github.io/images/humble-bundle.png" />
-</div>
-<p>For 1+ USD you can get three books including "Doing Math with Python"! For 15+ USD you get nine excellent Python books!</p>
-<p>Get the bundle <a class="reference external" href="https://www.humblebundle.com/books/python-book-bundle">here</a>!</p>
-Trying out the code on Ubuntu 16.042016-10-05T09:00:00+10:002016-10-05T09:00:00+10:00Amit Sahatag:doingmathwithpython.github.io,2016-10-05:/install-on-ubuntu16.04.html<p class="first last">Code on Ubuntu 15.04</p>
-<p>If you are using Ubuntu 16.04 and don't want to install the Anaconda
-Python distribution for trying out the book's
-<a class="reference external" href="http://doingmathwithpython.github.io/pages/programs.html">programs</a> or
-the <a class="reference external" href="http://doingmathwithpython.github.io/trying-out-solutions.html">sample solutions</a>, this
-post is for you.</p>
-<p>Ubuntu 16.04 already comes with Python 3 installed, so we only need to install
-the following packages - matplotlib, matplotlib-venn, sympy and idle3.</p>
-<p>Open a terminal and do the following:</p>
-<pre class="code literal-block">
-$ sudo apt-get update
-$ sudo apt-get install python3-matplotlib python3-matplotlib-venn python3-sympy idle3
-</pre>
-<p>It's worth noting that this will install sympy 0.7.6 and matplotlib 1.5.1 which are
-both sufficient for the book's programs.</p>
-<div class="section" id="starting-idle-editor">
-<h2>Starting IDLE editor</h2>
-<p>You can now start the IDLE editor by typing in "idle3" from the terminal and then it's ready
-for your programs!</p>
-</div>
-<div class="section" id="contact">
-<h2>Contact</h2>
-<p>If you find any issues please email me at
-<tt class="docutils literal">doingmathwithpython@gmail.com</tt> or post your query/tip to any of the
-following community forums:</p>
-<ul class="simple">
-<li><a class="reference external" href="https://www.facebook.com/doingmathwithpython">Facebook page</a></li>
-<li><a class="reference external" href="https://plus.google.com/u/0/communities/113121562865298236232">G+ Community</a></li>
-</ul>
-</div>
-Video: Doing Math with Python2016-08-16T12:00:00+10:002016-08-16T12:00:00+10:00Amit Sahatag:doingmathwithpython.github.io,2016-08-16:/video-pyconau-dmwp.html<p class="first last">PyConAU2016</p>
-<p>I spoke at the PyCon Australia Education Seminar on August 12, 2016. The video of the talk is now up.
-Thanks to Next Day Video!</p>
-<div class="youtube youtube-16x9"><iframe src="https://www.youtube.com/embed/XJOt4QQgx0A" allowfullscreen seamless frameBorder="0"></iframe></div><p>The PDF slides and the demos as Jupyter Notebooks (Python 3) are <a class="reference external" href="https://github.com/doingmathwithpython/pycon-au-2016">here</a>. I have some instructions to download them and try them out. If you face any issues, or have a question, please let me know.</p>
-<p>Thank you to all the PyCon Australia organizers and the Education seminar organizers for a great mini conference
-and the opportunity to be a part of it.</p>
-PyCon Australia 2016 Education Seminar2016-08-12T11:27:00+10:002016-08-12T11:27:00+10:00Amit Sahatag:doingmathwithpython.github.io,2016-08-12:/pycon-au-edu-summit-talk.html<p class="first last">PyCon AU education summit talk</p>
-<p>I attended the PyCon Australia 2016 Education seminar held on 12th August at Melbourne, Australia.
-I loved the energy of the seminar and was great to hear about all the ways educators in Australia are
-using Python for their teaching. Here are some notes I took, which I also link with the videos. You can
-find all the videos <a class="reference external" href="https://www.youtube.com/playlist?list=PLs4CJRBY5F1Jh6fFqT1p5TZRx5q06CcaR">here</a>.</p>
-<div class="section" id="python-at-monash">
-<h2>Python at Monash</h2>
-<ul class="simple">
-<li>Faculty of IT</li>
-<li>Python close to pseudocode</li>
-<li>Jupyter Notebooks</li>
-<li>Jupyter Hub installation at Monash</li>
-</ul>
-</div>
-<div class="section" id="keynote-smart-city-from-earth-to-mars-and-back">
-<h2>Keynote: Smart City - From earth to mars and back</h2>
-<ul class="simple">
-<li><a class="reference external" href="https://www.youtube.com/watch?v=BZExUKogvjQ&list=PLs4CJRBY5F1Jh6fFqT1p5TZRx5q06CcaR&index=8">Video</a></li>
-<li>Find a social mission</li>
-</ul>
-</div>
-<div class="section" id="teaching-python">
-<h2>Teaching Python</h2>
-<ul class="simple">
-<li><a class="reference external" href="https://www.youtube.com/watch?v=7oIwVjEVn0c&list=PLs4CJRBY5F1Jh6fFqT1p5TZRx5q06CcaR&index=9">Video</a></li>
-<li>Teaching isn't easy</li>
-<li>Programming isn't easy, it's new</li>
-<li>Grok learning, interactivepython.org, coursera, codecadaemy..</li>
-<li>Emphasise the fundamentals, don't assume anything, be explicit</li>
-</ul>
-</div>
-<div class="section" id="python-with-minecraft">
-<h2>Python with Minecraft</h2>
-<ul class="simple">
-<li><a class="reference external" href="https://www.youtube.com/watch?v=WwKkA9YV1K8&list=PLs4CJRBY5F1Jh6fFqT1p5TZRx5q06CcaR&index=7">Video</a></li>
-<li>Get kids excited</li>
-<li>Consumers to creators</li>
-</ul>
-</div>
-<div class="section" id="micropython">
-<h2>MicroPython</h2>
-<ul class="simple">
-<li><a class="reference external" href="https://www.youtube.com/watch?v=oCEZyJqkMrE&list=PLs4CJRBY5F1Jh6fFqT1p5TZRx5q06CcaR&index=6">Video</a></li>
-<li>Groklearning Microbit</li>
-<li><a class="reference external" href="https://groklearning.com/competition/codequest-microbit-2016/">https://groklearning.com/competition/codequest-microbit-2016/</a></li>
-</ul>
-</div>
-<div class="section" id="teaching-geometry-using-logo-python-turtle-module">
-<h2>Teaching Geometry using Logo/Python turtle module</h2>
-<ul class="simple">
-<li><a class="reference external" href="https://www.youtube.com/watch?v=gu3QDizt-_Y&list=PLs4CJRBY5F1Jh6fFqT1p5TZRx5q06CcaR&index=5">Video</a></li>
-<li>Don't teach subjects in silos</li>
-<li>Show students you can do real useful stuff with programming</li>
-<li>Turtle powered Geometry</li>
-<li>Grok learning lessons (turtle in your browser)</li>
-</ul>
-</div>
-PyCon Australia 2016 Education Seminar: Doing Math with Python2016-08-06T18:00:00+10:002016-08-06T18:00:00+10:00Amit Sahatag:doingmathwithpython.github.io,2016-08-06:/pyconau-dmwp.html<p class="first last">PyConAU2016</p>
-<p>Hello everyone, I will be <a class="reference external" href="https://2016.pycon-au.org/schedule/83/view_talk?day=friday">speaking</a> at the PyCon AU education seminar coming August 12, 2016 at Melbourne, Australia (3.00 - 3.40 PM).</p>
-<p>I have put up my in progress slides (PDF) and the demos as Jupyter Notebooks (Python 3), I plan to use during the talk on <a class="reference external" href="https://github.com/doingmathwithpython/pycon-au-2016">GitHub</a>. If you are coming along, please let me know if there is anything specific I can share and discuss.</p>
-<p><strong>Links</strong></p>
-<ul class="simple">
-<li><a class="reference external" href="https://2016.pycon-au.org/schedule/83/view_talk?day=friday">Talk abstract</a></li>
-<li><a class="reference external" href="https://github.com/doingmathwithpython/pycon-au-2016">Slides and Demos</a></li>
-</ul>
-O'Reilly Webcast: Doing Math with Python2016-07-01T14:00:00+10:002016-07-01T14:00:00+10:00Amit Sahatag:doingmathwithpython.github.io,2016-07-01:/oreilly-webcast-doing-math.html<p class="first last">O'Reilly Webcast</p>
-<p><strong>Updated post after the webcast</strong></p>
-<p>A big thank you to all of you who turned up for the webcast across the world. I really had a great time and hope the session was informative to all of you. For those who didn't make it to the webcast, it's now available for <a class="reference external" href="http://www.oreilly.com/pub/e/3712">viewing</a>.</p>
-<p>The slides, transcript and the demos are all available at the <a class="reference external" href="https://github.com/doingmathwithpython/oreilly-webcast-2016">GitHub repository</a>. Feel free to use them in any capacity you find useful. If you already have <a class="reference external" href="https://doingmathwithpython.github.io/pages/software-installation.html">Anaconda installed</a>, get the above code, and run <cite>jupyter-notebook</cite> from the same directory to be able to play with the code.</p>
-<p><em>Links of Interest</em></p>
-<ul class="simple">
-<li><a class="reference external" href="http://www.oreilly.com/pub/e/3712">Webcast Recording</a></li>
-<li><a class="reference external" href="https://github.com/doingmathwithpython/oreilly-webcast-2016">Slides, Transcript and Demos</a></li>
-<li><a class="reference external" href="https://www.nostarch.com/doingmathwithpython">Doing Math with Python book</a></li>
-</ul>
-<p>Some of you asked a number of questions which I couldn't answer as well as I would have wanted to during the webcast, so I will make a better attempt below:</p>
-<p><strong>Q: What is the difference between an interpreter, ide and text editor? And what do you recommend for beginners?</strong></p>
-<p>An <tt class="docutils literal">interpreter</tt> is what runs your program. Without going into the details, the Python interpreter is what converts a statement such as <tt class="docutils literal"><span class="pre">print("Hello")</span></tt> to a form that can be understood by the computer to finally print <tt class="docutils literal">Hello</tt> on screen.
-An <tt class="docutils literal">IDE</tt> or Integrated Development Environment is a software application where we can write programs and run them usually via Graphical User Interface. IDEs generally feature helpful features such as code completion and can be useful when working with large projects. A <tt class="docutils literal">text editor</tt> is for writing our programs or other text. It usually doesn't support features that an IDE would support but of course, you can configure and enhance text editors to give you IDE-like features.</p>
-<p>For beginners, I recommend starting with text editors. I think that doesn't overwhelm someone who is learning with the IDE features. That said, <a class="reference external" href="https://docs.python.org/3/library/idle.html">IDLE</a> is a good in-between choice for beginners and one that I personally use in the book and definitely would be my first choice.</p>
-<p><strong>Q: What library do we use for importing metric units that works well with sympy?</strong></p>
-<p>I would recommend taking a look at SymPy's <a class="reference external" href="http://docs.sympy.org/dev/modules/physics/units.html#">Units</a> module and see if it has what you need. In addition, and if you already don't know about it, <a class="reference external" href="https://github.com/hgrecco/pint">pint</a> would be another library to look at.</p>
-<p><strong>Q: Do you use notebook for exploratory work?</strong></p>
-<p>Yes, I use notebook for exploratory work. I think notebooks are great when you want the code and result together in a single document. It's great for sharing too. I recently created <a class="reference external" href="http://echorand.me/presentation-slides-with-jupyter-notebook.html#.V3XhNe0yphE">slides</a> as a Notebook.</p>
-<p><strong>Q: Can Sympy be used for the development in a engineering software (i.e. Finite Element Method)? Would the computational speed be (good)? (Not sure about the second part of the question)</strong></p>
-<p>You may be interested in taking a look at <a class="reference external" href="http://sfepy.org/doc-devel/index.html">SfePy</a></p>
-<p><strong>Q: Thoughts on Cython? Sagemath?</strong></p>
-<p>I haven't worked much with Cython. I know about it and what it can useful for. So, I guess if you are looking for speed, definitely look into it. I would also recommend looking at <a class="reference external" href="http://numba.pydata.org/">Numba</a>. Sagemath is more of a system itself than a library. It integrates popular Python libraries and would definitely be something to explore.</p>
-<p><strong>Q: Should students use IDLE or a notebook format?</strong></p>
-<p>I would recommend using IDLE to start with. It gives the opportunity for the student to at least get an idea of the cycle of editing code and running it. I would only introduce notebook later and in addition to IDLE. Both have their merits, but Notebook just introduces one more thing to grasp in the beginning.</p>
-<p><strong>Q: Any recommendations for introducing 3D graphics e.g. polyhedrons on screen?</strong></p>
-<p>I haven't explored them, you may want to look at <a class="reference external" href="https://pi3d.github.io/html/">Pi3D</a> or <a class="reference external" href="http://vpython.org/">VPython</a>.</p>
-<p><strong>Q: How well do SymPy and Numpy work together?</strong></p>
-<p>No personal experience, but searching a bit, it looks like you may want to look at SymPy's <a class="reference external" href="http://docs.sympy.org/dev/modules/utilities/lambdify.html">Lambdify</a> feature. The <a class="reference external" href="https://groups.google.com/forum/#!forum/sympy">SymPy google group</a> may give you a better answer.</p>
-<p><strong>Q: You are working in Jupyter - can the "app"s you should be embedded in a regular HTML web page?</strong></p>
-<p>I haven't personally tried this. I think this <a class="reference external" href="https://jakevdp.github.io/blog/2013/12/05/static-interactive-widgets/">post</a> may give you clues to do it. O'Reilly Media's project <a class="reference external" href="https://github.com/oreillymedia/thebe">thebe</a> may be another option to look at.</p>
-<p><strong>Announcement post</strong></p>
-<p>I am very excited to share that I am doing a webcast this coming week with O'Reilly titled
-"Doing Math with Python". You can register for it on the <a class="reference external" href="http://www.oreilly.com/pub/e/3712">event page</a>.</p>
-<p>Here are the date and time of the webcast:</p>
-<ul class="simple">
-<li>Wed, June 29th at 7 PM, San Francisco</li>
-<li>Wed, June 29th at 10pm, New York</li>
-<li>Thu, Jun 30th at 3am - London</li>
-<li>Thu, Jun 30th at 7:30am - Mumbai</li>
-<li>Thu, Jun 30th at 10am - Beijing</li>
-<li>Thu, Jun 30th at 11am - Tokyo</li>
-<li>Thu, Jun 30th at 12pm - Sydney</li>
-</ul>
-<p>I have created a <a class="reference external" href="https://github.com/doingmathwithpython/oreilly-webcast-2016">GitHub repository</a> which
-will have the rough transcript, final slides and the code examples as Jupyter Notebooks.</p>
-Python 2016 Education Summit Notes2016-05-29T17:00:00+10:002016-05-29T17:00:00+10:00Amit Sahatag:doingmathwithpython.github.io,2016-05-29:/education-summit-pycon-2016.html<p class="first last">Education Summit Summary</p>
-<p>I participated in the education summit today. My talk slides for "Doing Math with Python" is available <a class="reference external" href="https://doingmathwithpython.github.io/pycon-us-2016/#/">here</a>.</p>
-<p>Here are some notes on the other talks I attended.</p>
-<div class="section" id="keynote">
-<h2>Keynote</h2>
-<ul class="simple">
-<li>Education WG</li>
-<li>PythonZero</li>
-<li>GPIO Zero</li>
-<li>Network zero: <a class="reference external" href="https://github.com/tjguk/networkzero/">https://github.com/tjguk/networkzero/</a></li>
-<li>Zero: based on an established package, emphasis is on up-and-running use in a classroom, Relevant error messages</li>
-</ul>
-<p>Micro:bit</p>
-<ul class="simple">
-<li>Mu, demos</li>
-</ul>
-</div>
-<div class="section" id="lessons-learned-from-teaching-python">
-<h2>Lessons learned from teaching Python</h2>
-<ul class="simple">
-<li>Put your work out there on the internet</li>
-<li>Think about internationalization</li>
-<li>Self publish Amazon's create space, Kindle</li>
-<li>Quizzes, collect data, data mining</li>
-<li>Instructor section</li>
-<li>Online markup of code</li>
-<li>EpicPen</li>
-<li>YouTube channel</li>
-<li>Libraries: Pygame, Arcade</li>
-</ul>
-</div>
-<div class="section" id="pyzero">
-<h2>Pyzero</h2>
-<ul class="simple">
-<li>Demos</li>
-<li>pzrun</li>
-</ul>
-</div>
-<div class="section" id="minecraft-with-python">
-<h2>Minecraft with Python</h2>
-<ul class="simple">
-<li>Use Python to interact with Minecraft</li>
-<li>CoderDojo Minecraft bundle</li>
-<li>Using Jupyter Notebooks</li>
-</ul>
-</div>
-<div class="section" id="pycharm-edu">
-<h2>PyCharm Edu</h2>
-<ul class="simple">
-<li>Courses</li>
-<li>Checkout PyCharm EDU for creating courses</li>
-</ul>
-</div>
-<div class="section" id="teaching-data-structures-with-python">
-<h2>Teaching data structures with Python</h2>
-<ul class="simple">
-<li>Python makes the teacher happy</li>
-<li>Lab only</li>
-<li>Algorithms in Python + C (Side by side)</li>
-<li>Two languages worked well for them.</li>
-<li>Low level language: easy to find the complexity of the algorithm</li>
-<li>High level language: hard to find the complexity of the algorithm</li>
-</ul>
-</div>
-<div class="section" id="merlin-for-data-science-education">
-<h2>Merlin for Data Science Education</h2>
-<ul class="simple">
-<li>Where to even start?</li>
-<li>Effort justification</li>
-<li>Spending 2hr out of a 8hr session in fixing something is not worth it</li>
-<li>Shouldn't be proud of battling with tool set rather than not doing the real work</li>
-<li>Merlin - <a class="reference external" href="http://www.darklabsdatascience.com/project_merlin/">http://www.darklabsdatascience.com/project_merlin/</a></li>
-</ul>
-</div>
-PyCon Education Summit Talk2016-05-26T11:27:00+10:002016-05-26T11:27:00+10:00Amit Sahatag:doingmathwithpython.github.io,2016-05-26:/pycon-edu-summit-talk.html<p class="first last">PyCon education summit talk</p>
-<p>Hi everyone, I have uploaded the <a class="reference external" href="https://doingmathwithpython.github.io/pycon-us-2016/">slides</a> for my upcoming talk at the PyCon Education Summit. If you are coming to the talk, feel free to have a look at the slides and have any questions/comments ready for me.</p>
-<p>The slides are made using Jupyter Notebook + nbconvert magic. Thank you to everyone who makes these things happen. You can see the slides notebook <a class="reference external" href="https://github.com/doingmathwithpython/pycon-us-2016">here</a>.</p>
-<p>As a PyCon special, No Starch Press has setup a discount code <tt class="docutils literal">PYCONMATH</tt> code which will give you 30 % off my book, <a class="reference external" href="https://www.nostarch.com/doingmathwithpython">Doing Math with Python</a> and is valid from May 26th - June 8th.</p>
-SymPy 1.0 and Anaconda 4.0 releases2016-04-11T19:50:00+10:002016-04-11T19:50:00+10:00Amit Sahatag:doingmathwithpython.github.io,2016-04-11:/sympy-1.0-anaconda-4.0.html<p class="first last">sympy 1.0 and Anaconda 4.0</p>
-<p><a class="reference external" href="http://sympy.org">SymPy 1.0</a> was released recently and <a class="reference external" href="https://www.continuum.io/blog/developer-blog/anaconda-4-release">Anaconda 4.0</a>
-was just released. I tried all the <a class="reference external" href="http://doingmathwithpython.github.io/trying-out-solutions.html">sample solutions</a>
-and everything works as expected. The <a class="reference external" href="http://doingmathwithpython.github.io/pages/programs.html">chapter programs</a> should
-keep working as well.</p>
-<p>You can get both the updates when you install Anaconda 4.0 or updated
-your existing Anaconda installation:</p>
-<pre class="code literal-block">
-$ conda update conda
-$ conda update anaconda
-</pre>
-<p>I have so far verified both on Mac OS X and Linux. If you find any
-issues on Windows, please email me at
-<tt class="docutils literal">doingmathwithpython@gmail.com</tt> or post your query/tip to any of the
-following community forums:</p>
-<ul class="simple">
-<li><a class="reference external" href="https://www.facebook.com/doingmathwithpython">Facebook page</a></li>
-<li><a class="reference external" href="https://plus.google.com/u/0/communities/113121562865298236232">G+ Community</a></li>
-</ul>
-What readers are saying2016-02-14T10:00:00+10:002016-02-14T10:00:00+10:00Amit Sahatag:doingmathwithpython.github.io,2016-02-14:/what-readers-are-saying.html<p class="first last">Reviews of Doing Math with Python</p>
-<p>Readers have shared how they are finding <em>Doing Math with Python</em> by
-posting reviews on Amazon and their own blog. You can view all of them
-on the <a class="reference external" href="http://doingmathwithpython.github.io/pages/reviews.html">Reviews</a> page.</p>
-<p>Some readers have also been kind enough to let me know personally how the book
-has helped them to restart their programming, or looking at something
-they have been putting off. As the author, I think this is the highest
-level of appreciation that I could have hoped for.</p>
-<p>Recently, Aaron Meurer (the lead developer of SymPy) mentioned the
-book in an <a class="reference external" href="http://pythonpodcast.com/aaron-meurer-sympy.html">episode</a> of
-Podcast.__init__ titled "SymPy with Aaron Meurer". If you are curious
-to learn more about SymPy, I would recommend listening to it.</p>
-<p>I am curious to hear more. If you want to get in touch personally,
-please do so via any of the following channels:</p>
-<ul class="simple">
-<li><a class="reference external" href="https://www.facebook.com/doingmathwithpython">Facebook page</a></li>
-<li><a class="reference external" href="https://plus.google.com/u/0/communities/113121562865298236232">G+ Community</a></li>
-<li><a class="reference external" href="https://twitter.com/mathwithpython">Twitter</a></li>
-</ul>
-<p>You can email me at <a class="reference external" href="mailto:doingmathwithpython@gmail.com">doingmathwithpython@gmail.com</a>.</p>
-<p>Alternatively, if you just plan to write a review, please do so on
-Amazon, O'Reilly or your personal blog.</p>
-Trying out the solutions in IDLE2015-11-18T08:20:00+10:002015-11-18T08:20:00+10:00Amit Sahatag:doingmathwithpython.github.io,2015-11-18:/trying-out-solutions.html<p class="first last">Trying out the solutions</p>
-<p>Once you <a class="reference external" href="https://www.nostarch.com/download/doingmath_code.zip">download</a> the solutions ZIP file, and extract it you will
-find the solutions for each chapter in the corresponding sub-directory.</p>
-<div class="figure align-center">
-<img alt="Extracted ZIP archive" src="http://doingmathwithpython.github.io/images/zip-extracted.png" />
-</div>
-<p>The <strong>PDF</strong> file contains explanations for each of the solutions
-similar to the explanations for the programs in the book.</p>
-<p>Before you can try the programs out, you will have to open them first in IDLE.
-Let's consider the solution to a challenge posed in Chapter 6 to draw
-the Mandelbrot set - <tt class="docutils literal">mandelbrot.py</tt>. Start <tt class="docutils literal">IDLE</tt> and click on the menu item <tt class="docutils literal">File >
-Open</tt> and navigate to the location where you extracted the directory
-above and open the file <tt class="docutils literal">mandelbrot.py</tt>.</p>
-<div class="figure align-center">
-<img alt="IDLE window" src="http://doingmathwithpython.github.io/images/idle-1.png" />
-<p class="caption">Snapshot of the source code</p>
-</div>
-<div class="section" id="running-the-program">
-<h2>Running the program</h2>
-<p>To run the program, click on <tt class="docutils literal">Run > Run Module</tt> and you should see
-the Mandelbrot set in the matplotlib window.</p>
-<div class="figure align-center">
-<img alt="Mandelbrot Set" src="http://doingmathwithpython.github.io/images/idle-2.png" />
-<p class="caption">Mandelbrot set</p>
-</div>
-<p>All the solutions should be ready to run, try them out, make changes
-to experiment and let me know what you come up with!</p>
-<p>Email me at <tt class="docutils literal">doingmathwithpython@gmail.com</tt> or post your query/tip to any of the
-following community forums:</p>
-<ul class="simple">
-<li><a class="reference external" href="https://www.facebook.com/doingmathwithpython">Facebook page</a></li>
-<li><a class="reference external" href="https://plus.google.com/u/0/communities/113121562865298236232">G+ Community</a></li>
-</ul>
-</div>
-Breaking long lines in Python2015-11-04T12:00:00+10:002015-11-04T12:00:00+10:00Amit Sahatag:doingmathwithpython.github.io,2015-11-04:/breaking-long-lines-in-python.html<p class="first last">Breaking long lines in Python</p>
-<p>In some of the programs discussed in the book including the sample solutions, you will see statements like:</p>
-<pre class="code literal-block">
-print('Area: {0}, Estimated ({1}): {2}'.
- format(area_of_circle, points, estimate(radius, points)))
-</pre>
-<p>This is really the following single statement:</p>
-<pre class="code literal-block">
-print('Area: {0}, Estimated ({1}): {2}'.format(area_of_circle, points, estimate(radius, points)))
-</pre>
-<p>The first code snippet above is an example of breaking a long line into two (or more) lines so that we don't end up with really long lines in our code. How long should a line be when you should think about breaking it? If your statement's length is more than 80 characters, you should think about breaking it up.</p>
-<p>In the book, we often had to do so because of layout reasons even though the statement may not have exceeded 80 characters, and in your projects you will want to do it so that your statements are easier to read and on the average all lines have a similar length. This is formalized (among other things) in <a class="reference external" href="https://www.python.org/dev/peps/pep-0008/">PEP 8</a>.</p>
-<p>Note that the examples below will for illustrative purposes break lines waaaaay less than 80 characters.</p>
-<div class="section" id="how-do-you-break">
-<h2>How do you break?</h2>
-<div class="section" id="when-not-calling-function">
-<h3>When not calling function</h3>
-<p>When you are not calling a function, you essentially have two choices:</p>
-<p><strong>Use paranthesis</strong></p>
-<p>This is exactly how we break the long statement in the example we started this article with. For the moment ignore the call to <tt class="docutils literal">print()</tt> and assume that the statement is:</p>
-<pre class="code literal-block">
-s = 'Area: {0}, Estimated ({1}): {2}'.format(area_of_circle, points, estimate(radius, points))
-</pre>
-<p>This essentially just creates the string <tt class="docutils literal">s</tt>. If we were to split this statement over multiple lines, we would do the following:</p>
-<pre class="code literal-block">
-s = ('Area: {0}, Estimated ({1}): {2}'
- .format(area_of_circle, points, estimate(radius, points)))
-</pre>
-<p>Note the extra beginning and the ending parenthesis.</p>
-<p>Here is another example:</p>
-<pre class="code literal-block">
-s1 = x + x**2/2 + x**3/3 + x**4/4 + x**5/5 + x**6/6 + x**7/7 + x**8/8
-</pre>
-<p>Here is how we can use split the above statment into multiple lines using parentheses:</p>
-<pre class="code literal-block">
-s3 = (x + x**2/2 + x**3/3
- + x**4/4 + x**5/5
- + x**6/6 + x**7/7
- + x**8/8)
-</pre>
-<p><strong>Use the line continuation operator</strong></p>
-<p>The line continuation operator, <tt class="docutils literal">\</tt> can be used to split long statements over multiple lines. Here is how we could split the above statement using <tt class="docutils literal">\</tt> instead:</p>
-<pre class="code literal-block">
-s3 = x + x**2/2 + x**3/3 \
- + x**4/4 + x**5/5 \
- + x**6/6 + x**7/7 \
- + x**8/8
-</pre>
-<p>At the end of every line (except the last), we just add a <tt class="docutils literal">\</tt> indicating that the next line is also a part of the same statement.</p>
-<p><strong>Breaking up those long if statements</strong></p>
-<p>Often I have to break long <tt class="docutils literal">if</tt> statements and is in fact one of the most common cases I face at work where I have to break the statement into multiple lines. Here is an example using both the approaches above:</p>
-<pre class="code literal-block">
-# Using parenthesis
-if (cond1 and cond2 and cond3
- and cond4):
- # True block
-else:
- # False block
-
-# Using line continuation operator
-if cond1 and cond2 and cond3 \
- and cond4:
- # True block
-else:
- # False block
-</pre>
-</div>
-<div class="section" id="when-calling-functions">
-<h3>When calling functions</h3>
-<p>By default, when calling functions you can just press enter and without doing anything more keep writing your statement over multiple lines. For example:</p>
-<pre class="code literal-block">
-x = 1
-print(x,
- x)
-</pre>
-<p>Hence, we <cite>could</cite> have broken the first example we saw as:</p>
-<pre class="code literal-block">
-print('Area: {0}, Estimated ({1}): {2}'.format(area_of_circle,
- points,
- estimate(radius, points)))
-</pre>
-<p>When calling <tt class="docutils literal">format()</tt> we put the arguments over separate lines.</p>
-</div>
-</div>
-<div class="section" id="learning-more-about-python-coding-style">
-<h2>Learning more about Python coding style</h2>
-<p>If you liked reading this article, you may also find it worth your time going over the <a class="reference external" href="https://www.python.org/dev/peps/pep-0008/">Python style guide</a>. You may even find instances where I have not followed a guideline when writing the programs in the book. If you find one, let me know.</p>
-</div>
-<div class="section" id="getting-in-touch">
-<h2>Getting in touch</h2>
-<p>Stay updated or get in touch:</p>
-<ul class="simple">
-<li><a class="reference external" href="https://www.facebook.com/doingmathwithpython">Facebook page</a></li>
-<li><a class="reference external" href="https://plus.google.com/u/0/communities/113121562865298236232">G+ Community</a></li>
-<li><a class="reference external" href="https://twitter.com/mathwithpython">Twitter</a></li>
-</ul>
-<p>You can contact me directly via:</p>
-<ul class="simple">
-<li>Twitter: <a class="reference external" href="https://twitter.com/mathwithpython">@mathwithpython</a></li>
-<li>Email : <a class="reference external" href="mailto:doingmathwithpython@gmail.com">doingmathwithpython@gmail.com</a></li>
-</ul>
-</div>
-Chapter code and Errata2015-09-11T08:20:00+10:002015-09-11T08:20:00+10:00Amit Sahatag:doingmathwithpython.github.io,2015-09-11:/chapter-code-errata.html<p class="first last">Chapter code and errata</p>
-<p>You can find the chapter programs and snippets linked from the <a class="reference external" href="http://doingmathwithpython.github.io/pages/programs.html">programs</a> page. They should be free
-from any error mentioned on the <a class="reference external" href="http://doingmathwithpython.github.io/pages/errata.html">errata</a> page.</p>
-<div class="section" id="stay-in-touch">
-<h2>Stay in touch</h2>
-<p>You can stay connected with the book, its readers and me via the
-following channels:</p>
-<ul class="simple">
-<li><a class="reference external" href="https://www.facebook.com/doingmathwithpython">Facebook page</a></li>
-<li><a class="reference external" href="https://plus.google.com/u/0/communities/113121562865298236232">G+ Community</a></li>
-<li><a class="reference external" href="https://twitter.com/mathwithpython">Twitter</a></li>
-</ul>
-<p>You can contact me directly via:</p>
-<ul class="simple">
-<li>Twitter: <a class="reference external" href="https://twitter.com/mathwithpython">@mathwithpython</a></li>
-<li>Email : <a class="reference external" href="mailto:doingmathwithpython@gmail.com">doingmathwithpython@gmail.com</a></li>
-</ul>
-</div>
-Set operations with Python set compared to SymPy's FiniteSet2015-09-05T23:00:00+10:002015-09-05T23:00:00+10:00Amit Sahatag:doingmathwithpython.github.io,2015-09-05:/Sets-in-SymPy-and-built-in-Python-sets.html<p class="first last">Sets in SymPy and built-in Python sets</p>
-<p><cite>Chapter 5</cite> (<a class="reference external" href="http://doingmathwithpython.github.io/pages/about.html">About</a>) of the book discusses working with mathematical sets in
-Python. While writing the chapter, I had a choice of whether to
-use Python 3's built-in <a class="reference external" href="https://docs.python.org/3.3/library/stdtypes.html?highlight=union#set-types-set-frozenset">set</a> data
-structure or use SymPy's (0.7.6 +) <tt class="docutils literal">FiniteSet</tt> class. I decided to go ahead
-with the latter. My choice is briefly explained towards the end of
-this post, but hopefully it will be clear before that.</p>
-<p>Next, I describe how you can use Python 3's built-in set data
-structure to create sets and perform set operations such as finding
-the union, intersection or cartesian product of sets. For comparison,
-I also show how you can do the same using SymPy's <tt class="docutils literal">FiniteSet</tt> class.</p>
-<div class="section" id="creating-a-set">
-<h2>Creating a set</h2>
-<p>We can create a set consisting of the elements <cite>{1, 2, 3}</cite> in Python 3
-as follows:</p>
-<div class="highlight"><pre><span></span><span class="o">>>></span> <span class="n">s1</span> <span class="o">=</span> <span class="p">{</span><span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> <span class="mi">3</span><span class="p">}</span>
-<span class="o">>>></span> <span class="n">s1</span>
-<span class="p">{</span><span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> <span class="mi">3</span><span class="p">}</span>
-</pre></div>
-<p>To create a set when the elements are already in a list (for
-example), we would use the following syntax:</p>
-<div class="highlight"><pre><span></span><span class="o">>>></span> <span class="n">items</span> <span class="o">=</span> <span class="p">[</span><span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> <span class="mi">3</span><span class="p">]</span>
-<span class="o">>>></span> <span class="n">s2</span> <span class="o">=</span> <span class="nb">set</span><span class="p">(</span><span class="n">items</span><span class="p">)</span>
-<span class="o">>>></span> <span class="n">s2</span>
-<span class="p">{</span><span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> <span class="mi">3</span><span class="p">}</span>
-</pre></div>
-<p>The comparative operations using SymPy's <tt class="docutils literal">FiniteSet</tt> class are:</p>
-<div class="highlight"><pre><span></span><span class="o">>>></span> <span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">FiniteSet</span>
-<span class="o">>>></span> <span class="n">s1</span> <span class="o">=</span> <span class="n">FiniteSet</span><span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> <span class="mi">3</span><span class="p">)</span>
-<span class="o">>>></span> <span class="n">s1</span>
-<span class="p">{</span><span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> <span class="mi">3</span><span class="p">}</span>
-
-<span class="o">>>></span> <span class="n">items</span> <span class="o">=</span> <span class="p">[</span><span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> <span class="mi">3</span><span class="p">]</span>
-<span class="o">>>></span> <span class="n">s2</span> <span class="o">=</span> <span class="n">FiniteSet</span><span class="p">(</span><span class="o">*</span><span class="n">items</span><span class="p">)</span>
-<span class="o">>>></span> <span class="n">s2</span>
-<span class="p">{</span><span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> <span class="mi">3</span><span class="p">}</span>
-</pre></div>
-<p>To create an <a class="reference external" href="https://en.wikipedia.org/wiki/Empty_set">empty set</a>,
-in Python 3 you would use create an empty <tt class="docutils literal">set</tt> object:</p>
-<div class="highlight"><pre><span></span><span class="o">>>></span> <span class="n">e</span> <span class="o">=</span> <span class="nb">set</span><span class="p">()</span>
-<span class="o">>>></span> <span class="n">e</span>
-<span class="nb">set</span><span class="p">()</span>
-</pre></div>
-<p>In SymPy, an empty set is represented by an <tt class="docutils literal">EmptySet</tt> object. Thus,
-you can either create an empty set by directly creating an
-<tt class="docutils literal">EmptySet</tt> object or by creating a <tt class="docutils literal">FiniteSet</tt> object without
-specifying any set members, like so:</p>
-<div class="highlight"><pre><span></span><span class="o">>>></span> <span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">EmptySet</span>
-<span class="o">>>></span> <span class="n">e</span> <span class="o">=</span> <span class="n">EmptySet</span><span class="p">()</span>
-<span class="o">>>></span> <span class="n">e</span>
-<span class="n">EmptySet</span><span class="p">()</span>
-<span class="o">>>></span> <span class="n">e</span> <span class="o">=</span> <span class="n">FiniteSet</span><span class="p">()</span>
-<span class="o">>>></span> <span class="n">e</span>
-<span class="n">EmptySet</span><span class="p">()</span>
-</pre></div>
-</div>
-<div class="section" id="cardinality-and-membership">
-<h2>Cardinality and Membership</h2>
-<p>The <tt class="docutils literal">len()</tt> function returns the number of set members for sets
-created using either of the above approaches.</p>
-<p>Similarly, to check if an item <tt class="docutils literal">x</tt> is present in a set, <tt class="docutils literal">s</tt>
-created using any of the above approaches, we can use the statement,
-<tt class="docutils literal">x in s</tt>.</p>
-</div>
-<div class="section" id="union-and-intersection">
-<h2>Union and intersection</h2>
-<p>The <tt class="docutils literal">union()</tt> method can be used in both cases to find the union of
-two or more sets:</p>
-<div class="highlight"><pre><span></span><span class="o">>>></span> <span class="n">s1</span> <span class="o">=</span> <span class="nb">set</span><span class="p">([</span><span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> <span class="mi">3</span><span class="p">])</span>
-<span class="o">>>></span> <span class="n">s2</span> <span class="o">=</span> <span class="nb">set</span><span class="p">([</span><span class="mi">2</span><span class="p">,</span> <span class="mi">3</span><span class="p">,</span> <span class="mi">4</span><span class="p">])</span>
-<span class="o">>>></span> <span class="n">s3</span> <span class="o">=</span> <span class="nb">set</span><span class="p">([</span><span class="mi">2</span><span class="p">,</span> <span class="mi">3</span><span class="p">,</span> <span class="mi">4</span><span class="p">,</span> <span class="mi">5</span><span class="p">])</span>
-<span class="o">>>></span> <span class="n">s1</span><span class="o">.</span><span class="n">union</span><span class="p">(</span><span class="n">s2</span><span class="p">)</span><span class="o">.</span><span class="n">union</span><span class="p">(</span><span class="n">s3</span><span class="p">)</span>
-<span class="p">{</span><span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> <span class="mi">3</span><span class="p">,</span> <span class="mi">4</span><span class="p">,</span> <span class="mi">5</span><span class="p">}</span>
-</pre></div>
-<p>Similary in the case of SymPy:</p>
-<div class="highlight"><pre><span></span><span class="o">>>></span> <span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">FiniteSet</span>
-<span class="o">>>></span> <span class="n">s1</span> <span class="o">=</span> <span class="n">FiniteSet</span><span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> <span class="mi">3</span><span class="p">)</span>
-<span class="o">>>></span> <span class="n">s2</span> <span class="o">=</span> <span class="n">FiniteSet</span><span class="p">(</span><span class="mi">2</span><span class="p">,</span> <span class="mi">3</span><span class="p">,</span> <span class="mi">4</span><span class="p">)</span>
-<span class="o">>>></span> <span class="n">s3</span> <span class="o">=</span> <span class="n">FiniteSet</span><span class="p">(</span><span class="mi">2</span><span class="p">,</span> <span class="mi">3</span><span class="p">,</span> <span class="mi">4</span><span class="p">,</span> <span class="mi">5</span><span class="p">)</span>
-<span class="o">>>></span> <span class="n">s1</span><span class="o">.</span><span class="n">union</span><span class="p">(</span><span class="n">s2</span><span class="p">)</span><span class="o">.</span><span class="n">union</span><span class="p">(</span><span class="n">s3</span><span class="p">)</span>
-<span class="p">{</span><span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> <span class="mi">3</span><span class="p">,</span> <span class="mi">4</span><span class="p">,</span> <span class="mi">5</span><span class="p">}</span>
-</pre></div>
-<p>The <tt class="docutils literal">intersection()</tt> method can be used to find the intersection of
-two or more sets created using either of the above approaches. Continuing
-with the above three sets:</p>
-<div class="highlight"><pre><span></span><span class="o">>>></span> <span class="n">s1</span> <span class="o">=</span> <span class="nb">set</span><span class="p">([</span><span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> <span class="mi">3</span><span class="p">])</span>
-<span class="o">>>></span> <span class="n">s2</span> <span class="o">=</span> <span class="nb">set</span><span class="p">([</span><span class="mi">2</span><span class="p">,</span> <span class="mi">3</span><span class="p">,</span> <span class="mi">4</span><span class="p">])</span>
-<span class="o">>>></span> <span class="n">s3</span> <span class="o">=</span> <span class="nb">set</span><span class="p">([</span><span class="mi">2</span><span class="p">,</span> <span class="mi">3</span><span class="p">,</span> <span class="mi">4</span><span class="p">,</span> <span class="mi">5</span><span class="p">])</span>
-<span class="o">>>></span> <span class="n">s1</span><span class="o">.</span><span class="n">intersection</span><span class="p">(</span><span class="n">s2</span><span class="p">)</span><span class="o">.</span><span class="n">intersection</span><span class="p">(</span><span class="n">s3</span><span class="p">)</span>
-<span class="p">{</span><span class="mi">2</span><span class="p">,</span> <span class="mi">3</span><span class="p">}</span>
-</pre></div>
-<p>Similary, in SymPy:</p>
-<div class="highlight"><pre><span></span><span class="o">>>></span> <span class="n">s1</span><span class="o">.</span><span class="n">intersection</span><span class="p">(</span><span class="n">s2</span><span class="p">)</span><span class="o">.</span><span class="n">intersection</span><span class="p">(</span><span class="n">s3</span><span class="p">)</span>
-<span class="p">{</span><span class="mi">2</span><span class="p">,</span> <span class="mi">3</span><span class="p">}</span>
-</pre></div>
-</div>
-<div class="section" id="cartesian-product">
-<h2>Cartesian product</h2>
-<p>To find the cartesian product of sets created via the built-in <tt class="docutils literal">set</tt>
-data structure, we have to use the <tt class="docutils literal">product()</tt> function in the
-<a class="reference external" href="https://docs.python.org/3/library/itertools.html#itertools.product">itertools</a>
-module:</p>
-<div class="highlight"><pre><span></span><span class="o">>>></span> <span class="n">s1</span> <span class="o">=</span> <span class="p">{</span><span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> <span class="mi">3</span><span class="p">}</span>
-<span class="o">>>></span> <span class="n">s2</span> <span class="o">=</span> <span class="p">{</span><span class="mi">4</span><span class="p">,</span> <span class="mi">5</span><span class="p">,</span> <span class="mi">6</span><span class="p">}</span>
-<span class="o">>>></span> <span class="kn">import</span> <span class="nn">itertools</span>
-<span class="o">>>></span> <span class="n">itertools</span><span class="o">.</span><span class="n">product</span><span class="p">(</span><span class="n">s1</span><span class="p">,</span> <span class="n">s2</span><span class="p">)</span>
-<span class="o"><</span><span class="n">itertools</span><span class="o">.</span><span class="n">product</span> <span class="nb">object</span> <span class="n">at</span> <span class="mh">0x10418c990</span><span class="o">></span>
-</pre></div>
-<p>However considering that the <cite>cartesian product</cite> of two sets <a class="reference external" href="http://mathinsight.org/definition/cartesian_product">should</a> be another set,
-the <tt class="docutils literal">product()</tt> function doesn't really then return the
-cartesian product itself, but (an iterator to) the elements in it. Hence, if we
-try to apply the result returned by the function directly to a method or
-function which is expected to be applicable to a set, it will fail. For
-example, <tt class="docutils literal">itertools.product(s1, <span class="pre">s2).union(s3)</span></tt> will result in an error, but
-<tt class="docutils literal">set(itertools.product(s1, <span class="pre">s2)).union(s3)</span></tt> will work.</p>
-<p>Using SymPy's <tt class="docutils literal">FiniteSet</tt>, you can use the <tt class="docutils literal">*</tt>
-(multiplication or product) operator to find the cartesian product
-and the result is a set itself. Thus, it is closer to what
-a cartesian product is mathematically. An example follows:</p>
-<div class="highlight"><pre><span></span><span class="o">>>></span> <span class="n">s1</span> <span class="o">=</span> <span class="n">FiniteSet</span><span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> <span class="mi">3</span><span class="p">)</span>
-<span class="o">>>></span> <span class="n">s2</span> <span class="o">=</span> <span class="n">FiniteSet</span><span class="p">(</span><span class="mi">4</span><span class="p">,</span> <span class="mi">5</span><span class="p">,</span> <span class="mi">6</span><span class="p">)</span>
-<span class="o">>>></span> <span class="o">>>></span> <span class="n">s3</span> <span class="o">=</span> <span class="n">FiniteSet</span><span class="p">(</span><span class="mi">7</span><span class="p">,</span> <span class="mi">8</span><span class="p">,</span> <span class="mi">9</span><span class="p">)</span>
-<span class="o">>>></span> <span class="p">(</span><span class="n">s1</span><span class="o">*</span><span class="n">s2</span><span class="p">)</span><span class="o">.</span><span class="n">union</span><span class="p">(</span><span class="n">s3</span><span class="p">)</span>
-<span class="p">{</span><span class="mi">7</span><span class="p">,</span> <span class="mi">8</span><span class="p">,</span> <span class="mi">9</span><span class="p">}</span> <span class="n">U</span> <span class="p">{</span><span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> <span class="mi">3</span><span class="p">}</span> <span class="n">x</span> <span class="p">{</span><span class="mi">4</span><span class="p">,</span> <span class="mi">5</span><span class="p">,</span> <span class="mi">6</span><span class="p">}</span>
-</pre></div>
-<p><strong>Cartesian product of a set with itself</strong></p>
-<p>To find the cartesian product of a set with itself, i.e. <cite>s1*s1</cite> for
-example, we pass in a keyword argument, <tt class="docutils literal">repeat</tt> while calling the
-<tt class="docutils literal">itertools.product()</tt> function. The value of <tt class="docutils literal">repeat</tt> is the
-<cite>power</cite> we want to raise the set to. Thus, <tt class="docutils literal">itertools.product(s1,
-repeat=2)</tt> will calculate the cartesian product, <cite>s1*s1</cite>:</p>
-<div class="highlight"><pre><span></span><span class="o">>>></span> <span class="n">s1</span> <span class="o">=</span> <span class="p">{</span><span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> <span class="mi">3</span><span class="p">}</span>
-<span class="o">>>></span> <span class="nb">set</span><span class="p">(</span><span class="n">itertools</span><span class="o">.</span><span class="n">product</span><span class="p">(</span><span class="n">s1</span><span class="p">,</span> <span class="n">repeat</span><span class="o">=</span><span class="mi">2</span><span class="p">))</span>
-<span class="p">{(</span><span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">),</span> <span class="p">(</span><span class="mi">3</span><span class="p">,</span> <span class="mi">2</span><span class="p">),</span> <span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="mi">3</span><span class="p">),</span> <span class="p">(</span><span class="mi">3</span><span class="p">,</span> <span class="mi">3</span><span class="p">),</span> <span class="p">(</span><span class="mi">3</span><span class="p">,</span> <span class="mi">1</span><span class="p">),</span> <span class="p">(</span><span class="mi">2</span><span class="p">,</span> <span class="mi">1</span><span class="p">),</span> <span class="p">(</span><span class="mi">2</span><span class="p">,</span> <span class="mi">3</span><span class="p">),</span> <span class="p">(</span><span class="mi">2</span><span class="p">,</span> <span class="mi">2</span><span class="p">),</span> <span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="mi">1</span><span class="p">)}</span>
-</pre></div>
-<p>In SymPy, the <tt class="docutils literal">**</tt> operator can be used for finding the cartesian
-product of a set with itself:</p>
-<div class="highlight"><pre><span></span><span class="o">>>></span> <span class="n">s1</span> <span class="o">=</span> <span class="n">FiniteSet</span><span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> <span class="mi">3</span><span class="p">)</span>
-<span class="o">>>></span> <span class="n">s1</span><span class="o">**</span><span class="mi">2</span>
-<span class="p">{</span><span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> <span class="mi">3</span><span class="p">}</span> <span class="n">x</span> <span class="p">{</span><span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> <span class="mi">3</span><span class="p">}</span>
-</pre></div>
-</div>
-<div class="section" id="subset-super-set-proper-subset-checking">
-<h2>Subset/super set/proper subset checking</h2>
-<p>The <tt class="docutils literal">issubset()</tt> and <tt class="docutils literal">issuperset()</tt> methods are available for sets
-created via either approaches to check if a set is a subset and super
-set of another, respectively. Thus, <tt class="docutils literal">s1.issubset(s2)</tt> will check if
-<cite>s1</cite> is a subset of <cite>s2</cite>.</p>
-<p><strong>Checking for proper subset and superset</strong></p>
-<p>To check if a set, <cite>s1</cite> is a <a class="reference external" href="http://mathworld.wolfram.com/ProperSubset.html">proper subset</a> of another set,
-<cite>s2</cite> when using built-in set, we can do the following:</p>
-<div class="highlight"><pre><span></span><span class="o">>>></span> <span class="n">s1</span> <span class="o">=</span> <span class="p">{</span><span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> <span class="mi">3</span><span class="p">}</span>
-<span class="o">>>></span> <span class="n">s2</span> <span class="o">=</span> <span class="p">{</span><span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> <span class="mi">3</span><span class="p">,</span> <span class="mi">4</span><span class="p">}</span>
-<span class="o">>>></span> <span class="n">s1</span><span class="o">.</span><span class="n">issubset</span><span class="p">(</span><span class="n">s2</span><span class="p">)</span> <span class="ow">and</span> <span class="n">s1</span> <span class="o">!=</span> <span class="n">s2</span>
-<span class="kc">True</span>
-</pre></div>
-<p>We can do something similar for <a class="reference external" href="http://mathinsight.org/definition/proper_superset">proper superset</a>.</p>
-<p>In SymPy, we have <tt class="docutils literal">is_proper_subset()</tt> and <tt class="docutils literal">is_proper_superset()</tt>
-methods which can be used to check if a set is a proper subset or
-superset of another, respectively. Thus, the above would be written as
-<tt class="docutils literal">s1.is_proper_subset(s2)</tt>.</p>
-</div>
-<div class="section" id="calculating-the-powerset">
-<h2>Calculating the powerset</h2>
-<p>For sets created via built-in <tt class="docutils literal">set</tt> data structure, there is no
-direct method available to create the <a class="reference external" href="https://www.mathsisfun.com/sets/power-set.html">power set</a>. However, you can use the
-<tt class="docutils literal">powerset</tt> recipe described in the <a class="reference external" href="https://docs.python.org/3/library/itertools.html#recipes">itertools documentation</a>.</p>
-<p>On the other hand, in SymPy, there is a <tt class="docutils literal">powerset()</tt> method
-available which returns the power set:</p>
-<div class="highlight"><pre><span></span><span class="o">>>></span> <span class="n">s1</span> <span class="o">=</span> <span class="n">FiniteSet</span><span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> <span class="mi">3</span><span class="p">)</span>
-<span class="o">>>></span> <span class="n">s1</span><span class="o">.</span><span class="n">powerset</span><span class="p">()</span>
-<span class="p">{</span><span class="n">EmptySet</span><span class="p">(),</span> <span class="p">{</span><span class="mi">1</span><span class="p">},</span> <span class="p">{</span><span class="mi">2</span><span class="p">},</span> <span class="p">{</span><span class="mi">3</span><span class="p">},</span> <span class="p">{</span><span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">},</span> <span class="p">{</span><span class="mi">1</span><span class="p">,</span> <span class="mi">3</span><span class="p">},</span> <span class="p">{</span><span class="mi">2</span><span class="p">,</span> <span class="mi">3</span><span class="p">},</span> <span class="p">{</span><span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> <span class="mi">3</span><span class="p">}}</span>
-</pre></div>
-<p>You can see that the <tt class="docutils literal">powerset()</tt> method returns the power <cite>set</cite> and not the
-elements in it.</p>
-</div>
-<div class="section" id="choice-of-sympy-s-finiteset-over-set">
-<h2>Choice of SymPy's <tt class="docutils literal">FiniteSet</tt> over <tt class="docutils literal">set</tt></h2>
-<p>From the above comparison, we can see that SymPy's <tt class="docutils literal">FiniteSet</tt>
-provides us with nice features such as being able to use the <tt class="docutils literal">*</tt>
-operator to find the cartesian product, <tt class="docutils literal">**</tt> operator to calculate
-the cartesian product with itself and <tt class="docutils literal">powerset()</tt> method for calculating the
-power set. These are not present when using the built-in <tt class="docutils literal">set</tt> data
-structure. This was certainly a big driving factor in my choice,
-since SymPy was also being used in other chapters of the book.</p>
-<p>However, a <em>key</em> reason for my choice was that I wanted to show how we
-can create sets which did not allow addition or removal once created -
-like mathematical sets. This need was fulfilled by SymPy's
-<tt class="docutils literal">FiniteSet</tt> since it used Python's <tt class="docutils literal">frozenset</tt> data structure and
-not the <tt class="docutils literal">set</tt> data sturcture.</p>
-<p>The alternative to that would have
-been to use <tt class="docutils literal">frozenset</tt> directly, but I just did not like the idea
-of it and I would have also missed out on the nice features
-<tt class="docutils literal">FiniteSet</tt> would provide (eventually). I should note here that once
-I had made the decision to go with <tt class="docutils literal">FiniteSet</tt>, I <a class="reference external" href="https://github.com/amitsaha/sympy/commits?author=amitsaha">contributed</a> patches
-to SymPy to make the methods of <tt class="docutils literal">FiniteSet</tt> more compatible with Python's built in set
-and also implement minor features I discussed above.</p>
-</div>
-Doing Math with Python Available now!2015-09-02T08:00:00+10:002015-09-02T08:00:00+10:00Amit Sahatag:doingmathwithpython.github.io,2015-09-02:/available-now.html<p class="first last">Available now!</p>
-<p>Hi all, I am very excited to announce that the book is now available for
-purchase in print and electronic formats from various online stores
-including <a class="reference external" href="http://www.amazon.com/Doing-Math-Python-Programming-Statistics/dp/1593276400">Amazon</a>
-and <a class="reference external" href="https://www.nostarch.com/doingmathwithpython">No Starch Press</a>.
-Please see the <a class="reference external" href="http://doingmathwithpython.github.io/pages/buy.html">Buy</a> page for others.</p>
-<a class="reference external image-reference" href="http://www.nostarch.com/doingmathwithpython"><img alt="Book cover" class="align-center" src="http://doingmathwithpython.github.io/images/cover.png" /></a>
-<p>If you are keen to take a look at the contents and read a sample
-chapter, please head over to <a class="reference external" href="https://www.nostarch.com/doingmathwithpython">No Starch's book page</a>.</p>
-<p>Alternatively, if you are keen to recieve a review copy, please email
-<cite>doingmathwithpython@gmail.com</cite> and I will try to request one from the
-publishers.</p>
-<div class="section" id="stay-in-touch">
-<h2>Stay in touch</h2>
-<p>You can stay connected with the book, its readers and me via the
-following channels:</p>
-<ul class="simple">
-<li><a class="reference external" href="https://www.facebook.com/doingmathwithpython">Facebook page</a></li>
-<li><a class="reference external" href="https://plus.google.com/u/0/communities/113121562865298236232">G+ Community</a></li>
-<li><a class="reference external" href="https://twitter.com/mathwithpython">Twitter</a></li>
-</ul>
-<p>You can contact me directly via:</p>
-<ul class="simple">
-<li>Twitter: <a class="reference external" href="https://twitter.com/mathwithpython">@mathwithpython</a></li>
-<li>Email : <a class="reference external" href="mailto:doingmathwithpython@gmail.com">doingmathwithpython@gmail.com</a></li>
-</ul>
-</div>
-All chapters completed, off to the printers2015-08-15T23:27:00+10:002015-08-15T23:27:00+10:00Amit Sahatag:doingmathwithpython.github.io,2015-08-15:/off-to-printers.html<p class="first last">off to printers!</p>
-<p>I am very excited to write that all the chapters has been completed
-and the book is currently with the printers! You can find out more
-about the contents (including a detailed table of contents) from the
-<a class="reference external" href="http://doingmathwithpython.github.io/pages/about.html">About</a> page.</p>
-<p>You can stay connected with the book, its readers and me via the
-following channels:</p>
-<ul class="simple">
-<li><a class="reference external" href="https://www.facebook.com/doingmathwithpython">Facebook page</a></li>
-<li><a class="reference external" href="https://plus.google.com/u/0/communities/113121562865298236232">G+ Community</a></li>
-<li><a class="reference external" href="https://twitter.com/mathwithpython">Twitter</a></li>
-</ul>
-Introduction to "Doing Math with Python"2015-05-24T23:27:00+10:002015-05-24T23:27:00+10:00Amit Sahatag:doingmathwithpython.github.io,2015-05-24:/hello-world.html<p class="first last">Hello World</p>
-<p>Hi all, this is the blog for my book "Doing Math with Python".</p>
-<a class="reference external image-reference" href="http://www.nostarch.com/doingmathwithpython"><img alt="Book cover" class="align-center" src="http://doingmathwithpython.github.io/images/cover.png" /></a>
-<p>The first six chapters of the book are already available via the
-publisher's early access program. You can learn briefly about each
-chapter on the <a class="reference external" href="http://doingmathwithpython.github.io/pages/about.html">About</a> page.
-Going forward, I will be sharing updates regarding the book and posting
-original content related to that discussed in the book.</p>
-<p>You can stay connected with the book, its readers and me via the
-following channels:</p>
-<ul class="simple">
-<li><a class="reference external" href="https://www.facebook.com/doingmathwithpython">Facebook page</a></li>
-<li><a class="reference external" href="https://plus.google.com/u/0/communities/113121562865298236232">G+ Community</a></li>
-<li><a class="reference external" href="https://twitter.com/mathwithpython">Twitter</a></li>
-</ul>
-
\ No newline at end of file
diff --git a/feeds/amit-saha.atom.xml b/feeds/amit-saha.atom.xml
deleted file mode 100644
index 5ac0fe9..0000000
--- a/feeds/amit-saha.atom.xml
+++ /dev/null
@@ -1,855 +0,0 @@
-
-Doing Math with Python - Amit Sahahttp://doingmathwithpython.github.io/2023-10-25T13:20:00+10:00Doing Math with Python in Data Science Humble Bundle2023-10-25T13:20:00+10:002023-10-25T13:20:00+10:00Amit Sahatag:doingmathwithpython.github.io,2023-10-25:/humble-bundle-data-science.html<p class="first last">Humble bundle</p>
-<p>"Doing Math with Python" is part of No Starch Press's <a class="reference external" href="https://www.humblebundle.com/books/data-science-no-starch-press-books">Data Science Humble Bundle</a>
-running for the next 19 days. Your purchases will help support EFF!</p>
-<div class="figure align-center">
-<img alt="Humble Bundle" src="http://doingmathwithpython.github.io/images/data-science-humble-bundle.png" />
-</div>
-<p>Get the bundle <a class="reference external" href="https://www.humblebundle.com/books/data-science-no-starch-press-books">here</a>!</p>
-<p>I am still surprised that the book still continues to be relevant, and i am quietly happy that I could produce such a book,
-thanks to all the help i got from No Starch folks.</p>
-Chapter 3 - Google Correlate example update2020-07-11T00:00:00+10:002020-07-11T00:00:00+10:00Amit Sahatag:doingmathwithpython.github.io,2020-07-11:/chapter-3-google-correlate-example-update.html<p>In Chapter 3 on Page 87, the book refers to the Google Correlate service. However, as of December 2019, the service has been shutdown.
-Since the chapter requires you to download a CSV formatted data, it is no longer possible. However, you can instead download a version of
-the data …</p><p>In Chapter 3 on Page 87, the book refers to the Google Correlate service. However, as of December 2019, the service has been shutdown.
-Since the chapter requires you to download a CSV formatted data, it is no longer possible. However, you can instead download a version of
-the data that I had used 5 years back when writing the book from
-<a class="reference external" href="https://github.com/doingmathwithpython/code/blob/master/chapter3/solutions/correlate-summer.csv">here</a>.</p>
-<p>Thanks to a reader for pointing me to this issue.</p>
-Coding Starter Kit Humble Bundle2020-03-17T00:00:00+10:002020-03-17T00:00:00+10:00Amit Sahatag:doingmathwithpython.github.io,2020-03-17:/humble-bundle-coding-starter.html<p>I am very excited to share that "Doing Math with Python" is part of No Starch Press's <a class="reference external" href="https://www.humblebundle.com/books/coding-starter-kit-no-starch-press-books?mc_cid=01272437d1&mc_eid=a8fa0cb420">Coding Starter Humble Bundle</a>.
-Of course, you get No Starch Press's other excellent coding books as part of the bundle.</p>
-<p>It's on for the next 20 days!</p>
-<div class="figure align-left">
-<img alt="Humble Bundle" src="http://doingmathwithpython.github.io/images/coding-starter-humble-bundle.png" />
-</div>
-<p>Your purchases will help support the …</p><p>I am very excited to share that "Doing Math with Python" is part of No Starch Press's <a class="reference external" href="https://www.humblebundle.com/books/coding-starter-kit-no-starch-press-books?mc_cid=01272437d1&mc_eid=a8fa0cb420">Coding Starter Humble Bundle</a>.
-Of course, you get No Starch Press's other excellent coding books as part of the bundle.</p>
-<p>It's on for the next 20 days!</p>
-<div class="figure align-left">
-<img alt="Humble Bundle" src="http://doingmathwithpython.github.io/images/coding-starter-humble-bundle.png" />
-</div>
-<p>Your purchases will help support the No Starch Foundation and Scratch Foundation.</p>
-<p>Get the bundle <a class="reference external" href="https://www.humblebundle.com/books/coding-starter-kit-no-starch-press-books?mc_cid=01272437d1&mc_eid=a8fa0cb420">here</a>.</p>
-Number of trailing zeros in the factorial of an integer2020-01-02T19:50:00+10:002020-01-02T19:50:00+10:00Amit Sahatag:doingmathwithpython.github.io,2020-01-02:/trailing-zeros-factorial.html<p class="first last">Use Python to find the number of trailing zeros in the factorial of an integer</p>
-<p>I recently learned about a cool formula to calculate the number of
-trailing zeros in the factorial of a number. It has been a while since I
-wrote a program to do something like this. So, I decided to change that and
-write this blog post. Let's jump in.</p>
-<p>In the spirit of wring various "calculators" in the book, we will
-write a "number of trailing zero" calculator. First up though, let's refresh
-some key relevant concepts.</p>
-<p><strong>Factorial</strong>: The factorial of a number, <tt class="docutils literal">n</tt> denoted by <tt class="docutils literal">n!</tt> is the product <tt class="docutils literal"><span class="pre">n*(n-1)*(n-2)...*1</span></tt>.
-For example, <tt class="docutils literal">5! = 5*4*3*2*1 = 120</tt>.</p>
-<p><strong>Trailing zeros</strong>: The trailing zeros of a number is the number of zeros at the end of a number. For example,
-the number 567100 has <strong>two</strong> trailing zeros.</p>
-<p><strong>Floor</strong>: The floor of a number is the greatest integer less than or equal to x. That is floor of 3.2 is 3
-and that of 3.5 is 3 and the floor of 3 is 3 as well.</p>
-<p>Now, coming back to the focus of this post, this document at brilliant.org wiki
-explains the process in <a class="reference external" href="https://brilliant.org/wiki/trailing-number-of-zeros/">detail</a>.</p>
-<p>The key bit there in is this formula:</p>
-<div class="figure">
-<img alt="" src="http://doingmathwithpython.github.io/images/trailing_zeros_formula.png" />
-</div>
-<p>where, <tt class="docutils literal">n</tt> is the number for whose factorial we want to find the number of trailing zeros.</p>
-<p>The following Python program implements the above formula:</p>
-<pre class="code literal-block">
-import math
-
-
-def is_positive_integer(x):
- try:
- x = float(x)
- except ValueError:
- return False
- else:
- if x.is_integer() and x > 0:
- return True
- else:
- return False
-
-
-def trailing_zeros(num):
- if is_positive_integer(num):
- # The above function call has done all the sanity checks for us
- # so we can just convert this into an integer here
- num = int(num)
-
- k = math.floor(math.log(num, 5))
- zeros = 0
- for i in range(1, k + 1):
- zeros = zeros + math.floor(num/math.pow(5, i))
- return zeros
- else:
- print("Factorial of a non-positive non-integer is undefined")
-
-
-if __name__ == "__main__":
- fact_num = input(
- "Enter the number whose factorial's trailing zeros you want to find: "
- )
- num_zeros = trailing_zeros(fact_num)
- print("Number of trailing zeros: {0}".format(num_zeros))
-</pre>
-<p>When we run this program using Python 3, it will ask for the number whose factorial's number of trailing
-zeros we want to find and then print it out, like so:</p>
-<pre class="code literal-block">
-Enter the number whose factorial's trailing zeros you want to find: 5
-Number of trailing zeros: 1
-</pre>
-<p>If you enter a number which is not a positive integer, you will get an error message:</p>
-<pre class="code literal-block">
-Enter the number whose factorial's trailing zeros you want to find: 5.1
-Factorial of a non-positive integer is undefined
-Number of trailing zeros: None
-</pre>
-<p>Some key standard library functions we use in the above program are:</p>
-<ul class="simple">
-<li><tt class="docutils literal">math.floor</tt>: This function is used to find the floor of a number</li>
-<li><tt class="docutils literal">math.log</tt>: This function is used to find the logarithm of a number for a specified base (defaults to 10)</li>
-<li><tt class="docutils literal">math.pow</tt>: This function is used to find out the power of a number raised to another</li>
-</ul>
-<p>The above functions are defined in the <a class="reference external" href="https://docs.python.org/3/library/math.html">math module</a>.</p>
-<p>Besides the above, we use the <cite>is_integer()</cite> function defined on a floating point object to check
-if the floating point object is actually an integer.</p>
-<p>The latest version of the code is available <a class="reference external" href="https://github.com/doingmathwithpython/code/blob/master/explorations/trailing_zeros/trailing_zeros.py">here</a>.</p>
-Doing Math with Python in Python Humble Bundle2019-08-23T00:00:00+10:002019-08-23T00:00:00+10:00Amit Sahatag:doingmathwithpython.github.io,2019-08-23:/humble-bundle-python.html<p class="first last">Humble bundle Python</p>
-<p>"Doing Math with Python" is part of No Starch Press's <a class="reference external" href="https://www.humblebundle.com/books/python-programming-no-starch-books">Python Humble Bundle</a>.
-Of course, you get No Starch Press's other excellent Python books as part of the bundle. It's still on for the next 10 days!</p>
-<div class="figure align-left">
-<img alt="Humble Bundle" src="http://doingmathwithpython.github.io/images/python-humble-bundle.png" />
-</div>
-<p>Your purchases will help support the No Starch Foundation and Python Software Foundation.</p>
-<p>Get the bundle <a class="reference external" href="https://www.humblebundle.com/books/python-programming-no-starch-books">here</a>.</p>
-Doing Math with Python in Coder's Bookshelf Humble Bundle2019-03-29T00:00:00+10:002019-03-29T00:00:00+10:00Amit Sahatag:doingmathwithpython.github.io,2019-03-29:/humble-bundle-coders-bookshelf.html<p class="first last">Humble bundle</p>
-<p>"Doing Math with Python" is part of No Starch Press's "Pay what you want" <a class="reference external" href="https://www.humblebundle.com/books/coders-bookshelf-books">Coder's Bookshelf Bundle</a>.
-Your purchases will help support a charity of your choice.</p>
-<div class="figure align-center">
-<img alt="Humble Bundle" src="http://doingmathwithpython.github.io/images/humble-bundle-3.png" />
-</div>
-<p>Get the bundle <a class="reference external" href="https://www.humblebundle.com/books/coders-bookshelf-books">here</a>!</p>
-Doing Math with Python in Linux Geek Humble Bundle2018-07-24T13:20:00+10:002018-07-24T13:20:00+10:00Amit Sahatag:doingmathwithpython.github.io,2018-07-24:/humble-bundle-linux-geek.html<p class="first last">Humble bundle</p>
-<p>"Doing Math with Python" is part of No Starch Press's "Pay what you want" <a class="reference external" href="https://www.humblebundle.com/books/linux-geek-books">Linux Geek Humble Bundle</a>
-running for the next 7 days. Your purchases will help support EFF or a charity of your choice.</p>
-<div class="figure align-center">
-<img alt="Humble Bundle" src="http://doingmathwithpython.github.io/images/humble-bundle-2.png" />
-</div>
-<p>Get the bundle <a class="reference external" href="https://www.humblebundle.com/books/linux-geek-books">here</a>!</p>
-Anaconda 5.0 release2017-10-29T19:50:00+10:002017-10-29T19:50:00+10:00Amit Sahatag:doingmathwithpython.github.io,2017-10-29:/anaconda-5.0.html<p class="first last">Anaconda 5.0 release</p>
-<p><a class="reference external" href="https://www.anaconda.com/blog/developer-blog/announcing-the-release-of-anaconda-distribution-5-0/">Anaconda 5.0</a>
-was released a few days back. I tried all the <a class="reference external" href="http://doingmathwithpython.github.io/trying-out-solutions.html">sample solutions</a>
-and everything works as expected. The <a class="reference external" href="http://doingmathwithpython.github.io/pages/programs.html">chapter programs</a> should
-keep working as well.</p>
-<p>The versions of the relevant software in this release are:</p>
-<ul class="simple">
-<li>Python 3.6</li>
-<li>sympy 1.1.1</li>
-<li>matplotlib 2.1.0</li>
-</ul>
-<p>You can update your existing installation using:</p>
-<pre class="code literal-block">
-$ conda update conda
-$ conda install anaconda=5.0
-</pre>
-<p>(Thanks to Dan Wolfe for informing me of the incorrect command to install <cite>anaconda=5.0</cite>)</p>
-<p>A fresh installation of Anaconda 5.0 should still be similar to the <a class="reference external" href="https://doingmathwithpython.github.io/pages/software-installation.html">instructions</a>
-for earlier versions.</p>
-<div class="figure align-center">
-<img alt="Anaconda 5" src="http://doingmathwithpython.github.io/images/anaconda-5.png" />
-</div>
-<div class="figure align-center">
-<img alt="Anaconda 5" src="http://doingmathwithpython.github.io/images/anaconda-install-1.png" />
-</div>
-<div class="figure align-center">
-<img alt="Anaconda 5" src="http://doingmathwithpython.github.io/images/anaconda-install-2.png" />
-</div>
-<div class="figure align-center">
-<img alt="Anaconda 5" src="http://doingmathwithpython.github.io/images/anaconda-install-3.png" />
-</div>
-<p>I have so far verified both on Mac OS X and Linux. If you find any
-issues on Windows, please email me at
-<tt class="docutils literal">doingmathwithpython@gmail.com</tt> or post your query/tip to any of the
-following community forums:</p>
-<ul class="simple">
-<li><a class="reference external" href="https://www.facebook.com/doingmathwithpython">Facebook page</a></li>
-<li><a class="reference external" href="https://plus.google.com/u/0/communities/113121562865298236232">G+ Community</a></li>
-</ul>
-Doing Math with Python Humble Bundle2017-04-06T08:20:00+10:002017-04-06T08:20:00+10:00Amit Sahatag:doingmathwithpython.github.io,2017-04-06:/humble-bundle.html<p class="first last">Humble bundle</p>
-<p>No Starch Press has launched a "Pay what you want" <a class="reference external" href="https://www.humblebundle.com/books/python-book-bundle">Python Humble Bundle</a> running from April 5th - April 19th!
-Your purchases will help support the Python Software Foundation and I am excited to announce that Doing Math with Python is part of it.</p>
-<div class="figure align-center">
-<img alt="Humble Bundle" src="http://doingmathwithpython.github.io/images/humble-bundle.png" />
-</div>
-<p>For 1+ USD you can get three books including "Doing Math with Python"! For 15+ USD you get nine excellent Python books!</p>
-<p>Get the bundle <a class="reference external" href="https://www.humblebundle.com/books/python-book-bundle">here</a>!</p>
-Trying out the code on Ubuntu 16.042016-10-05T09:00:00+10:002016-10-05T09:00:00+10:00Amit Sahatag:doingmathwithpython.github.io,2016-10-05:/install-on-ubuntu16.04.html<p class="first last">Code on Ubuntu 15.04</p>
-<p>If you are using Ubuntu 16.04 and don't want to install the Anaconda
-Python distribution for trying out the book's
-<a class="reference external" href="http://doingmathwithpython.github.io/pages/programs.html">programs</a> or
-the <a class="reference external" href="http://doingmathwithpython.github.io/trying-out-solutions.html">sample solutions</a>, this
-post is for you.</p>
-<p>Ubuntu 16.04 already comes with Python 3 installed, so we only need to install
-the following packages - matplotlib, matplotlib-venn, sympy and idle3.</p>
-<p>Open a terminal and do the following:</p>
-<pre class="code literal-block">
-$ sudo apt-get update
-$ sudo apt-get install python3-matplotlib python3-matplotlib-venn python3-sympy idle3
-</pre>
-<p>It's worth noting that this will install sympy 0.7.6 and matplotlib 1.5.1 which are
-both sufficient for the book's programs.</p>
-<div class="section" id="starting-idle-editor">
-<h2>Starting IDLE editor</h2>
-<p>You can now start the IDLE editor by typing in "idle3" from the terminal and then it's ready
-for your programs!</p>
-</div>
-<div class="section" id="contact">
-<h2>Contact</h2>
-<p>If you find any issues please email me at
-<tt class="docutils literal">doingmathwithpython@gmail.com</tt> or post your query/tip to any of the
-following community forums:</p>
-<ul class="simple">
-<li><a class="reference external" href="https://www.facebook.com/doingmathwithpython">Facebook page</a></li>
-<li><a class="reference external" href="https://plus.google.com/u/0/communities/113121562865298236232">G+ Community</a></li>
-</ul>
-</div>
-Video: Doing Math with Python2016-08-16T12:00:00+10:002016-08-16T12:00:00+10:00Amit Sahatag:doingmathwithpython.github.io,2016-08-16:/video-pyconau-dmwp.html<p class="first last">PyConAU2016</p>
-<p>I spoke at the PyCon Australia Education Seminar on August 12, 2016. The video of the talk is now up.
-Thanks to Next Day Video!</p>
-<div class="youtube youtube-16x9"><iframe src="https://www.youtube.com/embed/XJOt4QQgx0A" allowfullscreen seamless frameBorder="0"></iframe></div><p>The PDF slides and the demos as Jupyter Notebooks (Python 3) are <a class="reference external" href="https://github.com/doingmathwithpython/pycon-au-2016">here</a>. I have some instructions to download them and try them out. If you face any issues, or have a question, please let me know.</p>
-<p>Thank you to all the PyCon Australia organizers and the Education seminar organizers for a great mini conference
-and the opportunity to be a part of it.</p>
-PyCon Australia 2016 Education Seminar2016-08-12T11:27:00+10:002016-08-12T11:27:00+10:00Amit Sahatag:doingmathwithpython.github.io,2016-08-12:/pycon-au-edu-summit-talk.html<p class="first last">PyCon AU education summit talk</p>
-<p>I attended the PyCon Australia 2016 Education seminar held on 12th August at Melbourne, Australia.
-I loved the energy of the seminar and was great to hear about all the ways educators in Australia are
-using Python for their teaching. Here are some notes I took, which I also link with the videos. You can
-find all the videos <a class="reference external" href="https://www.youtube.com/playlist?list=PLs4CJRBY5F1Jh6fFqT1p5TZRx5q06CcaR">here</a>.</p>
-<div class="section" id="python-at-monash">
-<h2>Python at Monash</h2>
-<ul class="simple">
-<li>Faculty of IT</li>
-<li>Python close to pseudocode</li>
-<li>Jupyter Notebooks</li>
-<li>Jupyter Hub installation at Monash</li>
-</ul>
-</div>
-<div class="section" id="keynote-smart-city-from-earth-to-mars-and-back">
-<h2>Keynote: Smart City - From earth to mars and back</h2>
-<ul class="simple">
-<li><a class="reference external" href="https://www.youtube.com/watch?v=BZExUKogvjQ&list=PLs4CJRBY5F1Jh6fFqT1p5TZRx5q06CcaR&index=8">Video</a></li>
-<li>Find a social mission</li>
-</ul>
-</div>
-<div class="section" id="teaching-python">
-<h2>Teaching Python</h2>
-<ul class="simple">
-<li><a class="reference external" href="https://www.youtube.com/watch?v=7oIwVjEVn0c&list=PLs4CJRBY5F1Jh6fFqT1p5TZRx5q06CcaR&index=9">Video</a></li>
-<li>Teaching isn't easy</li>
-<li>Programming isn't easy, it's new</li>
-<li>Grok learning, interactivepython.org, coursera, codecadaemy..</li>
-<li>Emphasise the fundamentals, don't assume anything, be explicit</li>
-</ul>
-</div>
-<div class="section" id="python-with-minecraft">
-<h2>Python with Minecraft</h2>
-<ul class="simple">
-<li><a class="reference external" href="https://www.youtube.com/watch?v=WwKkA9YV1K8&list=PLs4CJRBY5F1Jh6fFqT1p5TZRx5q06CcaR&index=7">Video</a></li>
-<li>Get kids excited</li>
-<li>Consumers to creators</li>
-</ul>
-</div>
-<div class="section" id="micropython">
-<h2>MicroPython</h2>
-<ul class="simple">
-<li><a class="reference external" href="https://www.youtube.com/watch?v=oCEZyJqkMrE&list=PLs4CJRBY5F1Jh6fFqT1p5TZRx5q06CcaR&index=6">Video</a></li>
-<li>Groklearning Microbit</li>
-<li><a class="reference external" href="https://groklearning.com/competition/codequest-microbit-2016/">https://groklearning.com/competition/codequest-microbit-2016/</a></li>
-</ul>
-</div>
-<div class="section" id="teaching-geometry-using-logo-python-turtle-module">
-<h2>Teaching Geometry using Logo/Python turtle module</h2>
-<ul class="simple">
-<li><a class="reference external" href="https://www.youtube.com/watch?v=gu3QDizt-_Y&list=PLs4CJRBY5F1Jh6fFqT1p5TZRx5q06CcaR&index=5">Video</a></li>
-<li>Don't teach subjects in silos</li>
-<li>Show students you can do real useful stuff with programming</li>
-<li>Turtle powered Geometry</li>
-<li>Grok learning lessons (turtle in your browser)</li>
-</ul>
-</div>
-PyCon Australia 2016 Education Seminar: Doing Math with Python2016-08-06T18:00:00+10:002016-08-06T18:00:00+10:00Amit Sahatag:doingmathwithpython.github.io,2016-08-06:/pyconau-dmwp.html<p class="first last">PyConAU2016</p>
-<p>Hello everyone, I will be <a class="reference external" href="https://2016.pycon-au.org/schedule/83/view_talk?day=friday">speaking</a> at the PyCon AU education seminar coming August 12, 2016 at Melbourne, Australia (3.00 - 3.40 PM).</p>
-<p>I have put up my in progress slides (PDF) and the demos as Jupyter Notebooks (Python 3), I plan to use during the talk on <a class="reference external" href="https://github.com/doingmathwithpython/pycon-au-2016">GitHub</a>. If you are coming along, please let me know if there is anything specific I can share and discuss.</p>
-<p><strong>Links</strong></p>
-<ul class="simple">
-<li><a class="reference external" href="https://2016.pycon-au.org/schedule/83/view_talk?day=friday">Talk abstract</a></li>
-<li><a class="reference external" href="https://github.com/doingmathwithpython/pycon-au-2016">Slides and Demos</a></li>
-</ul>
-O'Reilly Webcast: Doing Math with Python2016-07-01T14:00:00+10:002016-07-01T14:00:00+10:00Amit Sahatag:doingmathwithpython.github.io,2016-07-01:/oreilly-webcast-doing-math.html<p class="first last">O'Reilly Webcast</p>
-<p><strong>Updated post after the webcast</strong></p>
-<p>A big thank you to all of you who turned up for the webcast across the world. I really had a great time and hope the session was informative to all of you. For those who didn't make it to the webcast, it's now available for <a class="reference external" href="http://www.oreilly.com/pub/e/3712">viewing</a>.</p>
-<p>The slides, transcript and the demos are all available at the <a class="reference external" href="https://github.com/doingmathwithpython/oreilly-webcast-2016">GitHub repository</a>. Feel free to use them in any capacity you find useful. If you already have <a class="reference external" href="https://doingmathwithpython.github.io/pages/software-installation.html">Anaconda installed</a>, get the above code, and run <cite>jupyter-notebook</cite> from the same directory to be able to play with the code.</p>
-<p><em>Links of Interest</em></p>
-<ul class="simple">
-<li><a class="reference external" href="http://www.oreilly.com/pub/e/3712">Webcast Recording</a></li>
-<li><a class="reference external" href="https://github.com/doingmathwithpython/oreilly-webcast-2016">Slides, Transcript and Demos</a></li>
-<li><a class="reference external" href="https://www.nostarch.com/doingmathwithpython">Doing Math with Python book</a></li>
-</ul>
-<p>Some of you asked a number of questions which I couldn't answer as well as I would have wanted to during the webcast, so I will make a better attempt below:</p>
-<p><strong>Q: What is the difference between an interpreter, ide and text editor? And what do you recommend for beginners?</strong></p>
-<p>An <tt class="docutils literal">interpreter</tt> is what runs your program. Without going into the details, the Python interpreter is what converts a statement such as <tt class="docutils literal"><span class="pre">print("Hello")</span></tt> to a form that can be understood by the computer to finally print <tt class="docutils literal">Hello</tt> on screen.
-An <tt class="docutils literal">IDE</tt> or Integrated Development Environment is a software application where we can write programs and run them usually via Graphical User Interface. IDEs generally feature helpful features such as code completion and can be useful when working with large projects. A <tt class="docutils literal">text editor</tt> is for writing our programs or other text. It usually doesn't support features that an IDE would support but of course, you can configure and enhance text editors to give you IDE-like features.</p>
-<p>For beginners, I recommend starting with text editors. I think that doesn't overwhelm someone who is learning with the IDE features. That said, <a class="reference external" href="https://docs.python.org/3/library/idle.html">IDLE</a> is a good in-between choice for beginners and one that I personally use in the book and definitely would be my first choice.</p>
-<p><strong>Q: What library do we use for importing metric units that works well with sympy?</strong></p>
-<p>I would recommend taking a look at SymPy's <a class="reference external" href="http://docs.sympy.org/dev/modules/physics/units.html#">Units</a> module and see if it has what you need. In addition, and if you already don't know about it, <a class="reference external" href="https://github.com/hgrecco/pint">pint</a> would be another library to look at.</p>
-<p><strong>Q: Do you use notebook for exploratory work?</strong></p>
-<p>Yes, I use notebook for exploratory work. I think notebooks are great when you want the code and result together in a single document. It's great for sharing too. I recently created <a class="reference external" href="http://echorand.me/presentation-slides-with-jupyter-notebook.html#.V3XhNe0yphE">slides</a> as a Notebook.</p>
-<p><strong>Q: Can Sympy be used for the development in a engineering software (i.e. Finite Element Method)? Would the computational speed be (good)? (Not sure about the second part of the question)</strong></p>
-<p>You may be interested in taking a look at <a class="reference external" href="http://sfepy.org/doc-devel/index.html">SfePy</a></p>
-<p><strong>Q: Thoughts on Cython? Sagemath?</strong></p>
-<p>I haven't worked much with Cython. I know about it and what it can useful for. So, I guess if you are looking for speed, definitely look into it. I would also recommend looking at <a class="reference external" href="http://numba.pydata.org/">Numba</a>. Sagemath is more of a system itself than a library. It integrates popular Python libraries and would definitely be something to explore.</p>
-<p><strong>Q: Should students use IDLE or a notebook format?</strong></p>
-<p>I would recommend using IDLE to start with. It gives the opportunity for the student to at least get an idea of the cycle of editing code and running it. I would only introduce notebook later and in addition to IDLE. Both have their merits, but Notebook just introduces one more thing to grasp in the beginning.</p>
-<p><strong>Q: Any recommendations for introducing 3D graphics e.g. polyhedrons on screen?</strong></p>
-<p>I haven't explored them, you may want to look at <a class="reference external" href="https://pi3d.github.io/html/">Pi3D</a> or <a class="reference external" href="http://vpython.org/">VPython</a>.</p>
-<p><strong>Q: How well do SymPy and Numpy work together?</strong></p>
-<p>No personal experience, but searching a bit, it looks like you may want to look at SymPy's <a class="reference external" href="http://docs.sympy.org/dev/modules/utilities/lambdify.html">Lambdify</a> feature. The <a class="reference external" href="https://groups.google.com/forum/#!forum/sympy">SymPy google group</a> may give you a better answer.</p>
-<p><strong>Q: You are working in Jupyter - can the "app"s you should be embedded in a regular HTML web page?</strong></p>
-<p>I haven't personally tried this. I think this <a class="reference external" href="https://jakevdp.github.io/blog/2013/12/05/static-interactive-widgets/">post</a> may give you clues to do it. O'Reilly Media's project <a class="reference external" href="https://github.com/oreillymedia/thebe">thebe</a> may be another option to look at.</p>
-<p><strong>Announcement post</strong></p>
-<p>I am very excited to share that I am doing a webcast this coming week with O'Reilly titled
-"Doing Math with Python". You can register for it on the <a class="reference external" href="http://www.oreilly.com/pub/e/3712">event page</a>.</p>
-<p>Here are the date and time of the webcast:</p>
-<ul class="simple">
-<li>Wed, June 29th at 7 PM, San Francisco</li>
-<li>Wed, June 29th at 10pm, New York</li>
-<li>Thu, Jun 30th at 3am - London</li>
-<li>Thu, Jun 30th at 7:30am - Mumbai</li>
-<li>Thu, Jun 30th at 10am - Beijing</li>
-<li>Thu, Jun 30th at 11am - Tokyo</li>
-<li>Thu, Jun 30th at 12pm - Sydney</li>
-</ul>
-<p>I have created a <a class="reference external" href="https://github.com/doingmathwithpython/oreilly-webcast-2016">GitHub repository</a> which
-will have the rough transcript, final slides and the code examples as Jupyter Notebooks.</p>
-Python 2016 Education Summit Notes2016-05-29T17:00:00+10:002016-05-29T17:00:00+10:00Amit Sahatag:doingmathwithpython.github.io,2016-05-29:/education-summit-pycon-2016.html<p class="first last">Education Summit Summary</p>
-<p>I participated in the education summit today. My talk slides for "Doing Math with Python" is available <a class="reference external" href="https://doingmathwithpython.github.io/pycon-us-2016/#/">here</a>.</p>
-<p>Here are some notes on the other talks I attended.</p>
-<div class="section" id="keynote">
-<h2>Keynote</h2>
-<ul class="simple">
-<li>Education WG</li>
-<li>PythonZero</li>
-<li>GPIO Zero</li>
-<li>Network zero: <a class="reference external" href="https://github.com/tjguk/networkzero/">https://github.com/tjguk/networkzero/</a></li>
-<li>Zero: based on an established package, emphasis is on up-and-running use in a classroom, Relevant error messages</li>
-</ul>
-<p>Micro:bit</p>
-<ul class="simple">
-<li>Mu, demos</li>
-</ul>
-</div>
-<div class="section" id="lessons-learned-from-teaching-python">
-<h2>Lessons learned from teaching Python</h2>
-<ul class="simple">
-<li>Put your work out there on the internet</li>
-<li>Think about internationalization</li>
-<li>Self publish Amazon's create space, Kindle</li>
-<li>Quizzes, collect data, data mining</li>
-<li>Instructor section</li>
-<li>Online markup of code</li>
-<li>EpicPen</li>
-<li>YouTube channel</li>
-<li>Libraries: Pygame, Arcade</li>
-</ul>
-</div>
-<div class="section" id="pyzero">
-<h2>Pyzero</h2>
-<ul class="simple">
-<li>Demos</li>
-<li>pzrun</li>
-</ul>
-</div>
-<div class="section" id="minecraft-with-python">
-<h2>Minecraft with Python</h2>
-<ul class="simple">
-<li>Use Python to interact with Minecraft</li>
-<li>CoderDojo Minecraft bundle</li>
-<li>Using Jupyter Notebooks</li>
-</ul>
-</div>
-<div class="section" id="pycharm-edu">
-<h2>PyCharm Edu</h2>
-<ul class="simple">
-<li>Courses</li>
-<li>Checkout PyCharm EDU for creating courses</li>
-</ul>
-</div>
-<div class="section" id="teaching-data-structures-with-python">
-<h2>Teaching data structures with Python</h2>
-<ul class="simple">
-<li>Python makes the teacher happy</li>
-<li>Lab only</li>
-<li>Algorithms in Python + C (Side by side)</li>
-<li>Two languages worked well for them.</li>
-<li>Low level language: easy to find the complexity of the algorithm</li>
-<li>High level language: hard to find the complexity of the algorithm</li>
-</ul>
-</div>
-<div class="section" id="merlin-for-data-science-education">
-<h2>Merlin for Data Science Education</h2>
-<ul class="simple">
-<li>Where to even start?</li>
-<li>Effort justification</li>
-<li>Spending 2hr out of a 8hr session in fixing something is not worth it</li>
-<li>Shouldn't be proud of battling with tool set rather than not doing the real work</li>
-<li>Merlin - <a class="reference external" href="http://www.darklabsdatascience.com/project_merlin/">http://www.darklabsdatascience.com/project_merlin/</a></li>
-</ul>
-</div>
-PyCon Education Summit Talk2016-05-26T11:27:00+10:002016-05-26T11:27:00+10:00Amit Sahatag:doingmathwithpython.github.io,2016-05-26:/pycon-edu-summit-talk.html<p class="first last">PyCon education summit talk</p>
-<p>Hi everyone, I have uploaded the <a class="reference external" href="https://doingmathwithpython.github.io/pycon-us-2016/">slides</a> for my upcoming talk at the PyCon Education Summit. If you are coming to the talk, feel free to have a look at the slides and have any questions/comments ready for me.</p>
-<p>The slides are made using Jupyter Notebook + nbconvert magic. Thank you to everyone who makes these things happen. You can see the slides notebook <a class="reference external" href="https://github.com/doingmathwithpython/pycon-us-2016">here</a>.</p>
-<p>As a PyCon special, No Starch Press has setup a discount code <tt class="docutils literal">PYCONMATH</tt> code which will give you 30 % off my book, <a class="reference external" href="https://www.nostarch.com/doingmathwithpython">Doing Math with Python</a> and is valid from May 26th - June 8th.</p>
-SymPy 1.0 and Anaconda 4.0 releases2016-04-11T19:50:00+10:002016-04-11T19:50:00+10:00Amit Sahatag:doingmathwithpython.github.io,2016-04-11:/sympy-1.0-anaconda-4.0.html<p class="first last">sympy 1.0 and Anaconda 4.0</p>
-<p><a class="reference external" href="http://sympy.org">SymPy 1.0</a> was released recently and <a class="reference external" href="https://www.continuum.io/blog/developer-blog/anaconda-4-release">Anaconda 4.0</a>
-was just released. I tried all the <a class="reference external" href="http://doingmathwithpython.github.io/trying-out-solutions.html">sample solutions</a>
-and everything works as expected. The <a class="reference external" href="http://doingmathwithpython.github.io/pages/programs.html">chapter programs</a> should
-keep working as well.</p>
-<p>You can get both the updates when you install Anaconda 4.0 or updated
-your existing Anaconda installation:</p>
-<pre class="code literal-block">
-$ conda update conda
-$ conda update anaconda
-</pre>
-<p>I have so far verified both on Mac OS X and Linux. If you find any
-issues on Windows, please email me at
-<tt class="docutils literal">doingmathwithpython@gmail.com</tt> or post your query/tip to any of the
-following community forums:</p>
-<ul class="simple">
-<li><a class="reference external" href="https://www.facebook.com/doingmathwithpython">Facebook page</a></li>
-<li><a class="reference external" href="https://plus.google.com/u/0/communities/113121562865298236232">G+ Community</a></li>
-</ul>
-What readers are saying2016-02-14T10:00:00+10:002016-02-14T10:00:00+10:00Amit Sahatag:doingmathwithpython.github.io,2016-02-14:/what-readers-are-saying.html<p class="first last">Reviews of Doing Math with Python</p>
-<p>Readers have shared how they are finding <em>Doing Math with Python</em> by
-posting reviews on Amazon and their own blog. You can view all of them
-on the <a class="reference external" href="http://doingmathwithpython.github.io/pages/reviews.html">Reviews</a> page.</p>
-<p>Some readers have also been kind enough to let me know personally how the book
-has helped them to restart their programming, or looking at something
-they have been putting off. As the author, I think this is the highest
-level of appreciation that I could have hoped for.</p>
-<p>Recently, Aaron Meurer (the lead developer of SymPy) mentioned the
-book in an <a class="reference external" href="http://pythonpodcast.com/aaron-meurer-sympy.html">episode</a> of
-Podcast.__init__ titled "SymPy with Aaron Meurer". If you are curious
-to learn more about SymPy, I would recommend listening to it.</p>
-<p>I am curious to hear more. If you want to get in touch personally,
-please do so via any of the following channels:</p>
-<ul class="simple">
-<li><a class="reference external" href="https://www.facebook.com/doingmathwithpython">Facebook page</a></li>
-<li><a class="reference external" href="https://plus.google.com/u/0/communities/113121562865298236232">G+ Community</a></li>
-<li><a class="reference external" href="https://twitter.com/mathwithpython">Twitter</a></li>
-</ul>
-<p>You can email me at <a class="reference external" href="mailto:doingmathwithpython@gmail.com">doingmathwithpython@gmail.com</a>.</p>
-<p>Alternatively, if you just plan to write a review, please do so on
-Amazon, O'Reilly or your personal blog.</p>
-Trying out the solutions in IDLE2015-11-18T08:20:00+10:002015-11-18T08:20:00+10:00Amit Sahatag:doingmathwithpython.github.io,2015-11-18:/trying-out-solutions.html<p class="first last">Trying out the solutions</p>
-<p>Once you <a class="reference external" href="https://www.nostarch.com/download/doingmath_code.zip">download</a> the solutions ZIP file, and extract it you will
-find the solutions for each chapter in the corresponding sub-directory.</p>
-<div class="figure align-center">
-<img alt="Extracted ZIP archive" src="http://doingmathwithpython.github.io/images/zip-extracted.png" />
-</div>
-<p>The <strong>PDF</strong> file contains explanations for each of the solutions
-similar to the explanations for the programs in the book.</p>
-<p>Before you can try the programs out, you will have to open them first in IDLE.
-Let's consider the solution to a challenge posed in Chapter 6 to draw
-the Mandelbrot set - <tt class="docutils literal">mandelbrot.py</tt>. Start <tt class="docutils literal">IDLE</tt> and click on the menu item <tt class="docutils literal">File >
-Open</tt> and navigate to the location where you extracted the directory
-above and open the file <tt class="docutils literal">mandelbrot.py</tt>.</p>
-<div class="figure align-center">
-<img alt="IDLE window" src="http://doingmathwithpython.github.io/images/idle-1.png" />
-<p class="caption">Snapshot of the source code</p>
-</div>
-<div class="section" id="running-the-program">
-<h2>Running the program</h2>
-<p>To run the program, click on <tt class="docutils literal">Run > Run Module</tt> and you should see
-the Mandelbrot set in the matplotlib window.</p>
-<div class="figure align-center">
-<img alt="Mandelbrot Set" src="http://doingmathwithpython.github.io/images/idle-2.png" />
-<p class="caption">Mandelbrot set</p>
-</div>
-<p>All the solutions should be ready to run, try them out, make changes
-to experiment and let me know what you come up with!</p>
-<p>Email me at <tt class="docutils literal">doingmathwithpython@gmail.com</tt> or post your query/tip to any of the
-following community forums:</p>
-<ul class="simple">
-<li><a class="reference external" href="https://www.facebook.com/doingmathwithpython">Facebook page</a></li>
-<li><a class="reference external" href="https://plus.google.com/u/0/communities/113121562865298236232">G+ Community</a></li>
-</ul>
-</div>
-Breaking long lines in Python2015-11-04T12:00:00+10:002015-11-04T12:00:00+10:00Amit Sahatag:doingmathwithpython.github.io,2015-11-04:/breaking-long-lines-in-python.html<p class="first last">Breaking long lines in Python</p>
-<p>In some of the programs discussed in the book including the sample solutions, you will see statements like:</p>
-<pre class="code literal-block">
-print('Area: {0}, Estimated ({1}): {2}'.
- format(area_of_circle, points, estimate(radius, points)))
-</pre>
-<p>This is really the following single statement:</p>
-<pre class="code literal-block">
-print('Area: {0}, Estimated ({1}): {2}'.format(area_of_circle, points, estimate(radius, points)))
-</pre>
-<p>The first code snippet above is an example of breaking a long line into two (or more) lines so that we don't end up with really long lines in our code. How long should a line be when you should think about breaking it? If your statement's length is more than 80 characters, you should think about breaking it up.</p>
-<p>In the book, we often had to do so because of layout reasons even though the statement may not have exceeded 80 characters, and in your projects you will want to do it so that your statements are easier to read and on the average all lines have a similar length. This is formalized (among other things) in <a class="reference external" href="https://www.python.org/dev/peps/pep-0008/">PEP 8</a>.</p>
-<p>Note that the examples below will for illustrative purposes break lines waaaaay less than 80 characters.</p>
-<div class="section" id="how-do-you-break">
-<h2>How do you break?</h2>
-<div class="section" id="when-not-calling-function">
-<h3>When not calling function</h3>
-<p>When you are not calling a function, you essentially have two choices:</p>
-<p><strong>Use paranthesis</strong></p>
-<p>This is exactly how we break the long statement in the example we started this article with. For the moment ignore the call to <tt class="docutils literal">print()</tt> and assume that the statement is:</p>
-<pre class="code literal-block">
-s = 'Area: {0}, Estimated ({1}): {2}'.format(area_of_circle, points, estimate(radius, points))
-</pre>
-<p>This essentially just creates the string <tt class="docutils literal">s</tt>. If we were to split this statement over multiple lines, we would do the following:</p>
-<pre class="code literal-block">
-s = ('Area: {0}, Estimated ({1}): {2}'
- .format(area_of_circle, points, estimate(radius, points)))
-</pre>
-<p>Note the extra beginning and the ending parenthesis.</p>
-<p>Here is another example:</p>
-<pre class="code literal-block">
-s1 = x + x**2/2 + x**3/3 + x**4/4 + x**5/5 + x**6/6 + x**7/7 + x**8/8
-</pre>
-<p>Here is how we can use split the above statment into multiple lines using parentheses:</p>
-<pre class="code literal-block">
-s3 = (x + x**2/2 + x**3/3
- + x**4/4 + x**5/5
- + x**6/6 + x**7/7
- + x**8/8)
-</pre>
-<p><strong>Use the line continuation operator</strong></p>
-<p>The line continuation operator, <tt class="docutils literal">\</tt> can be used to split long statements over multiple lines. Here is how we could split the above statement using <tt class="docutils literal">\</tt> instead:</p>
-<pre class="code literal-block">
-s3 = x + x**2/2 + x**3/3 \
- + x**4/4 + x**5/5 \
- + x**6/6 + x**7/7 \
- + x**8/8
-</pre>
-<p>At the end of every line (except the last), we just add a <tt class="docutils literal">\</tt> indicating that the next line is also a part of the same statement.</p>
-<p><strong>Breaking up those long if statements</strong></p>
-<p>Often I have to break long <tt class="docutils literal">if</tt> statements and is in fact one of the most common cases I face at work where I have to break the statement into multiple lines. Here is an example using both the approaches above:</p>
-<pre class="code literal-block">
-# Using parenthesis
-if (cond1 and cond2 and cond3
- and cond4):
- # True block
-else:
- # False block
-
-# Using line continuation operator
-if cond1 and cond2 and cond3 \
- and cond4:
- # True block
-else:
- # False block
-</pre>
-</div>
-<div class="section" id="when-calling-functions">
-<h3>When calling functions</h3>
-<p>By default, when calling functions you can just press enter and without doing anything more keep writing your statement over multiple lines. For example:</p>
-<pre class="code literal-block">
-x = 1
-print(x,
- x)
-</pre>
-<p>Hence, we <cite>could</cite> have broken the first example we saw as:</p>
-<pre class="code literal-block">
-print('Area: {0}, Estimated ({1}): {2}'.format(area_of_circle,
- points,
- estimate(radius, points)))
-</pre>
-<p>When calling <tt class="docutils literal">format()</tt> we put the arguments over separate lines.</p>
-</div>
-</div>
-<div class="section" id="learning-more-about-python-coding-style">
-<h2>Learning more about Python coding style</h2>
-<p>If you liked reading this article, you may also find it worth your time going over the <a class="reference external" href="https://www.python.org/dev/peps/pep-0008/">Python style guide</a>. You may even find instances where I have not followed a guideline when writing the programs in the book. If you find one, let me know.</p>
-</div>
-<div class="section" id="getting-in-touch">
-<h2>Getting in touch</h2>
-<p>Stay updated or get in touch:</p>
-<ul class="simple">
-<li><a class="reference external" href="https://www.facebook.com/doingmathwithpython">Facebook page</a></li>
-<li><a class="reference external" href="https://plus.google.com/u/0/communities/113121562865298236232">G+ Community</a></li>
-<li><a class="reference external" href="https://twitter.com/mathwithpython">Twitter</a></li>
-</ul>
-<p>You can contact me directly via:</p>
-<ul class="simple">
-<li>Twitter: <a class="reference external" href="https://twitter.com/mathwithpython">@mathwithpython</a></li>
-<li>Email : <a class="reference external" href="mailto:doingmathwithpython@gmail.com">doingmathwithpython@gmail.com</a></li>
-</ul>
-</div>
-Chapter code and Errata2015-09-11T08:20:00+10:002015-09-11T08:20:00+10:00Amit Sahatag:doingmathwithpython.github.io,2015-09-11:/chapter-code-errata.html<p class="first last">Chapter code and errata</p>
-<p>You can find the chapter programs and snippets linked from the <a class="reference external" href="http://doingmathwithpython.github.io/pages/programs.html">programs</a> page. They should be free
-from any error mentioned on the <a class="reference external" href="http://doingmathwithpython.github.io/pages/errata.html">errata</a> page.</p>
-<div class="section" id="stay-in-touch">
-<h2>Stay in touch</h2>
-<p>You can stay connected with the book, its readers and me via the
-following channels:</p>
-<ul class="simple">
-<li><a class="reference external" href="https://www.facebook.com/doingmathwithpython">Facebook page</a></li>
-<li><a class="reference external" href="https://plus.google.com/u/0/communities/113121562865298236232">G+ Community</a></li>
-<li><a class="reference external" href="https://twitter.com/mathwithpython">Twitter</a></li>
-</ul>
-<p>You can contact me directly via:</p>
-<ul class="simple">
-<li>Twitter: <a class="reference external" href="https://twitter.com/mathwithpython">@mathwithpython</a></li>
-<li>Email : <a class="reference external" href="mailto:doingmathwithpython@gmail.com">doingmathwithpython@gmail.com</a></li>
-</ul>
-</div>
-Set operations with Python set compared to SymPy's FiniteSet2015-09-05T23:00:00+10:002015-09-05T23:00:00+10:00Amit Sahatag:doingmathwithpython.github.io,2015-09-05:/Sets-in-SymPy-and-built-in-Python-sets.html<p class="first last">Sets in SymPy and built-in Python sets</p>
-<p><cite>Chapter 5</cite> (<a class="reference external" href="http://doingmathwithpython.github.io/pages/about.html">About</a>) of the book discusses working with mathematical sets in
-Python. While writing the chapter, I had a choice of whether to
-use Python 3's built-in <a class="reference external" href="https://docs.python.org/3.3/library/stdtypes.html?highlight=union#set-types-set-frozenset">set</a> data
-structure or use SymPy's (0.7.6 +) <tt class="docutils literal">FiniteSet</tt> class. I decided to go ahead
-with the latter. My choice is briefly explained towards the end of
-this post, but hopefully it will be clear before that.</p>
-<p>Next, I describe how you can use Python 3's built-in set data
-structure to create sets and perform set operations such as finding
-the union, intersection or cartesian product of sets. For comparison,
-I also show how you can do the same using SymPy's <tt class="docutils literal">FiniteSet</tt> class.</p>
-<div class="section" id="creating-a-set">
-<h2>Creating a set</h2>
-<p>We can create a set consisting of the elements <cite>{1, 2, 3}</cite> in Python 3
-as follows:</p>
-<div class="highlight"><pre><span></span><span class="o">>>></span> <span class="n">s1</span> <span class="o">=</span> <span class="p">{</span><span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> <span class="mi">3</span><span class="p">}</span>
-<span class="o">>>></span> <span class="n">s1</span>
-<span class="p">{</span><span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> <span class="mi">3</span><span class="p">}</span>
-</pre></div>
-<p>To create a set when the elements are already in a list (for
-example), we would use the following syntax:</p>
-<div class="highlight"><pre><span></span><span class="o">>>></span> <span class="n">items</span> <span class="o">=</span> <span class="p">[</span><span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> <span class="mi">3</span><span class="p">]</span>
-<span class="o">>>></span> <span class="n">s2</span> <span class="o">=</span> <span class="nb">set</span><span class="p">(</span><span class="n">items</span><span class="p">)</span>
-<span class="o">>>></span> <span class="n">s2</span>
-<span class="p">{</span><span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> <span class="mi">3</span><span class="p">}</span>
-</pre></div>
-<p>The comparative operations using SymPy's <tt class="docutils literal">FiniteSet</tt> class are:</p>
-<div class="highlight"><pre><span></span><span class="o">>>></span> <span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">FiniteSet</span>
-<span class="o">>>></span> <span class="n">s1</span> <span class="o">=</span> <span class="n">FiniteSet</span><span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> <span class="mi">3</span><span class="p">)</span>
-<span class="o">>>></span> <span class="n">s1</span>
-<span class="p">{</span><span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> <span class="mi">3</span><span class="p">}</span>
-
-<span class="o">>>></span> <span class="n">items</span> <span class="o">=</span> <span class="p">[</span><span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> <span class="mi">3</span><span class="p">]</span>
-<span class="o">>>></span> <span class="n">s2</span> <span class="o">=</span> <span class="n">FiniteSet</span><span class="p">(</span><span class="o">*</span><span class="n">items</span><span class="p">)</span>
-<span class="o">>>></span> <span class="n">s2</span>
-<span class="p">{</span><span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> <span class="mi">3</span><span class="p">}</span>
-</pre></div>
-<p>To create an <a class="reference external" href="https://en.wikipedia.org/wiki/Empty_set">empty set</a>,
-in Python 3 you would use create an empty <tt class="docutils literal">set</tt> object:</p>
-<div class="highlight"><pre><span></span><span class="o">>>></span> <span class="n">e</span> <span class="o">=</span> <span class="nb">set</span><span class="p">()</span>
-<span class="o">>>></span> <span class="n">e</span>
-<span class="nb">set</span><span class="p">()</span>
-</pre></div>
-<p>In SymPy, an empty set is represented by an <tt class="docutils literal">EmptySet</tt> object. Thus,
-you can either create an empty set by directly creating an
-<tt class="docutils literal">EmptySet</tt> object or by creating a <tt class="docutils literal">FiniteSet</tt> object without
-specifying any set members, like so:</p>
-<div class="highlight"><pre><span></span><span class="o">>>></span> <span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">EmptySet</span>
-<span class="o">>>></span> <span class="n">e</span> <span class="o">=</span> <span class="n">EmptySet</span><span class="p">()</span>
-<span class="o">>>></span> <span class="n">e</span>
-<span class="n">EmptySet</span><span class="p">()</span>
-<span class="o">>>></span> <span class="n">e</span> <span class="o">=</span> <span class="n">FiniteSet</span><span class="p">()</span>
-<span class="o">>>></span> <span class="n">e</span>
-<span class="n">EmptySet</span><span class="p">()</span>
-</pre></div>
-</div>
-<div class="section" id="cardinality-and-membership">
-<h2>Cardinality and Membership</h2>
-<p>The <tt class="docutils literal">len()</tt> function returns the number of set members for sets
-created using either of the above approaches.</p>
-<p>Similarly, to check if an item <tt class="docutils literal">x</tt> is present in a set, <tt class="docutils literal">s</tt>
-created using any of the above approaches, we can use the statement,
-<tt class="docutils literal">x in s</tt>.</p>
-</div>
-<div class="section" id="union-and-intersection">
-<h2>Union and intersection</h2>
-<p>The <tt class="docutils literal">union()</tt> method can be used in both cases to find the union of
-two or more sets:</p>
-<div class="highlight"><pre><span></span><span class="o">>>></span> <span class="n">s1</span> <span class="o">=</span> <span class="nb">set</span><span class="p">([</span><span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> <span class="mi">3</span><span class="p">])</span>
-<span class="o">>>></span> <span class="n">s2</span> <span class="o">=</span> <span class="nb">set</span><span class="p">([</span><span class="mi">2</span><span class="p">,</span> <span class="mi">3</span><span class="p">,</span> <span class="mi">4</span><span class="p">])</span>
-<span class="o">>>></span> <span class="n">s3</span> <span class="o">=</span> <span class="nb">set</span><span class="p">([</span><span class="mi">2</span><span class="p">,</span> <span class="mi">3</span><span class="p">,</span> <span class="mi">4</span><span class="p">,</span> <span class="mi">5</span><span class="p">])</span>
-<span class="o">>>></span> <span class="n">s1</span><span class="o">.</span><span class="n">union</span><span class="p">(</span><span class="n">s2</span><span class="p">)</span><span class="o">.</span><span class="n">union</span><span class="p">(</span><span class="n">s3</span><span class="p">)</span>
-<span class="p">{</span><span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> <span class="mi">3</span><span class="p">,</span> <span class="mi">4</span><span class="p">,</span> <span class="mi">5</span><span class="p">}</span>
-</pre></div>
-<p>Similary in the case of SymPy:</p>
-<div class="highlight"><pre><span></span><span class="o">>>></span> <span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">FiniteSet</span>
-<span class="o">>>></span> <span class="n">s1</span> <span class="o">=</span> <span class="n">FiniteSet</span><span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> <span class="mi">3</span><span class="p">)</span>
-<span class="o">>>></span> <span class="n">s2</span> <span class="o">=</span> <span class="n">FiniteSet</span><span class="p">(</span><span class="mi">2</span><span class="p">,</span> <span class="mi">3</span><span class="p">,</span> <span class="mi">4</span><span class="p">)</span>
-<span class="o">>>></span> <span class="n">s3</span> <span class="o">=</span> <span class="n">FiniteSet</span><span class="p">(</span><span class="mi">2</span><span class="p">,</span> <span class="mi">3</span><span class="p">,</span> <span class="mi">4</span><span class="p">,</span> <span class="mi">5</span><span class="p">)</span>
-<span class="o">>>></span> <span class="n">s1</span><span class="o">.</span><span class="n">union</span><span class="p">(</span><span class="n">s2</span><span class="p">)</span><span class="o">.</span><span class="n">union</span><span class="p">(</span><span class="n">s3</span><span class="p">)</span>
-<span class="p">{</span><span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> <span class="mi">3</span><span class="p">,</span> <span class="mi">4</span><span class="p">,</span> <span class="mi">5</span><span class="p">}</span>
-</pre></div>
-<p>The <tt class="docutils literal">intersection()</tt> method can be used to find the intersection of
-two or more sets created using either of the above approaches. Continuing
-with the above three sets:</p>
-<div class="highlight"><pre><span></span><span class="o">>>></span> <span class="n">s1</span> <span class="o">=</span> <span class="nb">set</span><span class="p">([</span><span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> <span class="mi">3</span><span class="p">])</span>
-<span class="o">>>></span> <span class="n">s2</span> <span class="o">=</span> <span class="nb">set</span><span class="p">([</span><span class="mi">2</span><span class="p">,</span> <span class="mi">3</span><span class="p">,</span> <span class="mi">4</span><span class="p">])</span>
-<span class="o">>>></span> <span class="n">s3</span> <span class="o">=</span> <span class="nb">set</span><span class="p">([</span><span class="mi">2</span><span class="p">,</span> <span class="mi">3</span><span class="p">,</span> <span class="mi">4</span><span class="p">,</span> <span class="mi">5</span><span class="p">])</span>
-<span class="o">>>></span> <span class="n">s1</span><span class="o">.</span><span class="n">intersection</span><span class="p">(</span><span class="n">s2</span><span class="p">)</span><span class="o">.</span><span class="n">intersection</span><span class="p">(</span><span class="n">s3</span><span class="p">)</span>
-<span class="p">{</span><span class="mi">2</span><span class="p">,</span> <span class="mi">3</span><span class="p">}</span>
-</pre></div>
-<p>Similary, in SymPy:</p>
-<div class="highlight"><pre><span></span><span class="o">>>></span> <span class="n">s1</span><span class="o">.</span><span class="n">intersection</span><span class="p">(</span><span class="n">s2</span><span class="p">)</span><span class="o">.</span><span class="n">intersection</span><span class="p">(</span><span class="n">s3</span><span class="p">)</span>
-<span class="p">{</span><span class="mi">2</span><span class="p">,</span> <span class="mi">3</span><span class="p">}</span>
-</pre></div>
-</div>
-<div class="section" id="cartesian-product">
-<h2>Cartesian product</h2>
-<p>To find the cartesian product of sets created via the built-in <tt class="docutils literal">set</tt>
-data structure, we have to use the <tt class="docutils literal">product()</tt> function in the
-<a class="reference external" href="https://docs.python.org/3/library/itertools.html#itertools.product">itertools</a>
-module:</p>
-<div class="highlight"><pre><span></span><span class="o">>>></span> <span class="n">s1</span> <span class="o">=</span> <span class="p">{</span><span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> <span class="mi">3</span><span class="p">}</span>
-<span class="o">>>></span> <span class="n">s2</span> <span class="o">=</span> <span class="p">{</span><span class="mi">4</span><span class="p">,</span> <span class="mi">5</span><span class="p">,</span> <span class="mi">6</span><span class="p">}</span>
-<span class="o">>>></span> <span class="kn">import</span> <span class="nn">itertools</span>
-<span class="o">>>></span> <span class="n">itertools</span><span class="o">.</span><span class="n">product</span><span class="p">(</span><span class="n">s1</span><span class="p">,</span> <span class="n">s2</span><span class="p">)</span>
-<span class="o"><</span><span class="n">itertools</span><span class="o">.</span><span class="n">product</span> <span class="nb">object</span> <span class="n">at</span> <span class="mh">0x10418c990</span><span class="o">></span>
-</pre></div>
-<p>However considering that the <cite>cartesian product</cite> of two sets <a class="reference external" href="http://mathinsight.org/definition/cartesian_product">should</a> be another set,
-the <tt class="docutils literal">product()</tt> function doesn't really then return the
-cartesian product itself, but (an iterator to) the elements in it. Hence, if we
-try to apply the result returned by the function directly to a method or
-function which is expected to be applicable to a set, it will fail. For
-example, <tt class="docutils literal">itertools.product(s1, <span class="pre">s2).union(s3)</span></tt> will result in an error, but
-<tt class="docutils literal">set(itertools.product(s1, <span class="pre">s2)).union(s3)</span></tt> will work.</p>
-<p>Using SymPy's <tt class="docutils literal">FiniteSet</tt>, you can use the <tt class="docutils literal">*</tt>
-(multiplication or product) operator to find the cartesian product
-and the result is a set itself. Thus, it is closer to what
-a cartesian product is mathematically. An example follows:</p>
-<div class="highlight"><pre><span></span><span class="o">>>></span> <span class="n">s1</span> <span class="o">=</span> <span class="n">FiniteSet</span><span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> <span class="mi">3</span><span class="p">)</span>
-<span class="o">>>></span> <span class="n">s2</span> <span class="o">=</span> <span class="n">FiniteSet</span><span class="p">(</span><span class="mi">4</span><span class="p">,</span> <span class="mi">5</span><span class="p">,</span> <span class="mi">6</span><span class="p">)</span>
-<span class="o">>>></span> <span class="o">>>></span> <span class="n">s3</span> <span class="o">=</span> <span class="n">FiniteSet</span><span class="p">(</span><span class="mi">7</span><span class="p">,</span> <span class="mi">8</span><span class="p">,</span> <span class="mi">9</span><span class="p">)</span>
-<span class="o">>>></span> <span class="p">(</span><span class="n">s1</span><span class="o">*</span><span class="n">s2</span><span class="p">)</span><span class="o">.</span><span class="n">union</span><span class="p">(</span><span class="n">s3</span><span class="p">)</span>
-<span class="p">{</span><span class="mi">7</span><span class="p">,</span> <span class="mi">8</span><span class="p">,</span> <span class="mi">9</span><span class="p">}</span> <span class="n">U</span> <span class="p">{</span><span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> <span class="mi">3</span><span class="p">}</span> <span class="n">x</span> <span class="p">{</span><span class="mi">4</span><span class="p">,</span> <span class="mi">5</span><span class="p">,</span> <span class="mi">6</span><span class="p">}</span>
-</pre></div>
-<p><strong>Cartesian product of a set with itself</strong></p>
-<p>To find the cartesian product of a set with itself, i.e. <cite>s1*s1</cite> for
-example, we pass in a keyword argument, <tt class="docutils literal">repeat</tt> while calling the
-<tt class="docutils literal">itertools.product()</tt> function. The value of <tt class="docutils literal">repeat</tt> is the
-<cite>power</cite> we want to raise the set to. Thus, <tt class="docutils literal">itertools.product(s1,
-repeat=2)</tt> will calculate the cartesian product, <cite>s1*s1</cite>:</p>
-<div class="highlight"><pre><span></span><span class="o">>>></span> <span class="n">s1</span> <span class="o">=</span> <span class="p">{</span><span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> <span class="mi">3</span><span class="p">}</span>
-<span class="o">>>></span> <span class="nb">set</span><span class="p">(</span><span class="n">itertools</span><span class="o">.</span><span class="n">product</span><span class="p">(</span><span class="n">s1</span><span class="p">,</span> <span class="n">repeat</span><span class="o">=</span><span class="mi">2</span><span class="p">))</span>
-<span class="p">{(</span><span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">),</span> <span class="p">(</span><span class="mi">3</span><span class="p">,</span> <span class="mi">2</span><span class="p">),</span> <span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="mi">3</span><span class="p">),</span> <span class="p">(</span><span class="mi">3</span><span class="p">,</span> <span class="mi">3</span><span class="p">),</span> <span class="p">(</span><span class="mi">3</span><span class="p">,</span> <span class="mi">1</span><span class="p">),</span> <span class="p">(</span><span class="mi">2</span><span class="p">,</span> <span class="mi">1</span><span class="p">),</span> <span class="p">(</span><span class="mi">2</span><span class="p">,</span> <span class="mi">3</span><span class="p">),</span> <span class="p">(</span><span class="mi">2</span><span class="p">,</span> <span class="mi">2</span><span class="p">),</span> <span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="mi">1</span><span class="p">)}</span>
-</pre></div>
-<p>In SymPy, the <tt class="docutils literal">**</tt> operator can be used for finding the cartesian
-product of a set with itself:</p>
-<div class="highlight"><pre><span></span><span class="o">>>></span> <span class="n">s1</span> <span class="o">=</span> <span class="n">FiniteSet</span><span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> <span class="mi">3</span><span class="p">)</span>
-<span class="o">>>></span> <span class="n">s1</span><span class="o">**</span><span class="mi">2</span>
-<span class="p">{</span><span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> <span class="mi">3</span><span class="p">}</span> <span class="n">x</span> <span class="p">{</span><span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> <span class="mi">3</span><span class="p">}</span>
-</pre></div>
-</div>
-<div class="section" id="subset-super-set-proper-subset-checking">
-<h2>Subset/super set/proper subset checking</h2>
-<p>The <tt class="docutils literal">issubset()</tt> and <tt class="docutils literal">issuperset()</tt> methods are available for sets
-created via either approaches to check if a set is a subset and super
-set of another, respectively. Thus, <tt class="docutils literal">s1.issubset(s2)</tt> will check if
-<cite>s1</cite> is a subset of <cite>s2</cite>.</p>
-<p><strong>Checking for proper subset and superset</strong></p>
-<p>To check if a set, <cite>s1</cite> is a <a class="reference external" href="http://mathworld.wolfram.com/ProperSubset.html">proper subset</a> of another set,
-<cite>s2</cite> when using built-in set, we can do the following:</p>
-<div class="highlight"><pre><span></span><span class="o">>>></span> <span class="n">s1</span> <span class="o">=</span> <span class="p">{</span><span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> <span class="mi">3</span><span class="p">}</span>
-<span class="o">>>></span> <span class="n">s2</span> <span class="o">=</span> <span class="p">{</span><span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> <span class="mi">3</span><span class="p">,</span> <span class="mi">4</span><span class="p">}</span>
-<span class="o">>>></span> <span class="n">s1</span><span class="o">.</span><span class="n">issubset</span><span class="p">(</span><span class="n">s2</span><span class="p">)</span> <span class="ow">and</span> <span class="n">s1</span> <span class="o">!=</span> <span class="n">s2</span>
-<span class="kc">True</span>
-</pre></div>
-<p>We can do something similar for <a class="reference external" href="http://mathinsight.org/definition/proper_superset">proper superset</a>.</p>
-<p>In SymPy, we have <tt class="docutils literal">is_proper_subset()</tt> and <tt class="docutils literal">is_proper_superset()</tt>
-methods which can be used to check if a set is a proper subset or
-superset of another, respectively. Thus, the above would be written as
-<tt class="docutils literal">s1.is_proper_subset(s2)</tt>.</p>
-</div>
-<div class="section" id="calculating-the-powerset">
-<h2>Calculating the powerset</h2>
-<p>For sets created via built-in <tt class="docutils literal">set</tt> data structure, there is no
-direct method available to create the <a class="reference external" href="https://www.mathsisfun.com/sets/power-set.html">power set</a>. However, you can use the
-<tt class="docutils literal">powerset</tt> recipe described in the <a class="reference external" href="https://docs.python.org/3/library/itertools.html#recipes">itertools documentation</a>.</p>
-<p>On the other hand, in SymPy, there is a <tt class="docutils literal">powerset()</tt> method
-available which returns the power set:</p>
-<div class="highlight"><pre><span></span><span class="o">>>></span> <span class="n">s1</span> <span class="o">=</span> <span class="n">FiniteSet</span><span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> <span class="mi">3</span><span class="p">)</span>
-<span class="o">>>></span> <span class="n">s1</span><span class="o">.</span><span class="n">powerset</span><span class="p">()</span>
-<span class="p">{</span><span class="n">EmptySet</span><span class="p">(),</span> <span class="p">{</span><span class="mi">1</span><span class="p">},</span> <span class="p">{</span><span class="mi">2</span><span class="p">},</span> <span class="p">{</span><span class="mi">3</span><span class="p">},</span> <span class="p">{</span><span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">},</span> <span class="p">{</span><span class="mi">1</span><span class="p">,</span> <span class="mi">3</span><span class="p">},</span> <span class="p">{</span><span class="mi">2</span><span class="p">,</span> <span class="mi">3</span><span class="p">},</span> <span class="p">{</span><span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> <span class="mi">3</span><span class="p">}}</span>
-</pre></div>
-<p>You can see that the <tt class="docutils literal">powerset()</tt> method returns the power <cite>set</cite> and not the
-elements in it.</p>
-</div>
-<div class="section" id="choice-of-sympy-s-finiteset-over-set">
-<h2>Choice of SymPy's <tt class="docutils literal">FiniteSet</tt> over <tt class="docutils literal">set</tt></h2>
-<p>From the above comparison, we can see that SymPy's <tt class="docutils literal">FiniteSet</tt>
-provides us with nice features such as being able to use the <tt class="docutils literal">*</tt>
-operator to find the cartesian product, <tt class="docutils literal">**</tt> operator to calculate
-the cartesian product with itself and <tt class="docutils literal">powerset()</tt> method for calculating the
-power set. These are not present when using the built-in <tt class="docutils literal">set</tt> data
-structure. This was certainly a big driving factor in my choice,
-since SymPy was also being used in other chapters of the book.</p>
-<p>However, a <em>key</em> reason for my choice was that I wanted to show how we
-can create sets which did not allow addition or removal once created -
-like mathematical sets. This need was fulfilled by SymPy's
-<tt class="docutils literal">FiniteSet</tt> since it used Python's <tt class="docutils literal">frozenset</tt> data structure and
-not the <tt class="docutils literal">set</tt> data sturcture.</p>
-<p>The alternative to that would have
-been to use <tt class="docutils literal">frozenset</tt> directly, but I just did not like the idea
-of it and I would have also missed out on the nice features
-<tt class="docutils literal">FiniteSet</tt> would provide (eventually). I should note here that once
-I had made the decision to go with <tt class="docutils literal">FiniteSet</tt>, I <a class="reference external" href="https://github.com/amitsaha/sympy/commits?author=amitsaha">contributed</a> patches
-to SymPy to make the methods of <tt class="docutils literal">FiniteSet</tt> more compatible with Python's built in set
-and also implement minor features I discussed above.</p>
-</div>
-Doing Math with Python Available now!2015-09-02T08:00:00+10:002015-09-02T08:00:00+10:00Amit Sahatag:doingmathwithpython.github.io,2015-09-02:/available-now.html<p class="first last">Available now!</p>
-<p>Hi all, I am very excited to announce that the book is now available for
-purchase in print and electronic formats from various online stores
-including <a class="reference external" href="http://www.amazon.com/Doing-Math-Python-Programming-Statistics/dp/1593276400">Amazon</a>
-and <a class="reference external" href="https://www.nostarch.com/doingmathwithpython">No Starch Press</a>.
-Please see the <a class="reference external" href="http://doingmathwithpython.github.io/pages/buy.html">Buy</a> page for others.</p>
-<a class="reference external image-reference" href="http://www.nostarch.com/doingmathwithpython"><img alt="Book cover" class="align-center" src="http://doingmathwithpython.github.io/images/cover.png" /></a>
-<p>If you are keen to take a look at the contents and read a sample
-chapter, please head over to <a class="reference external" href="https://www.nostarch.com/doingmathwithpython">No Starch's book page</a>.</p>
-<p>Alternatively, if you are keen to recieve a review copy, please email
-<cite>doingmathwithpython@gmail.com</cite> and I will try to request one from the
-publishers.</p>
-<div class="section" id="stay-in-touch">
-<h2>Stay in touch</h2>
-<p>You can stay connected with the book, its readers and me via the
-following channels:</p>
-<ul class="simple">
-<li><a class="reference external" href="https://www.facebook.com/doingmathwithpython">Facebook page</a></li>
-<li><a class="reference external" href="https://plus.google.com/u/0/communities/113121562865298236232">G+ Community</a></li>
-<li><a class="reference external" href="https://twitter.com/mathwithpython">Twitter</a></li>
-</ul>
-<p>You can contact me directly via:</p>
-<ul class="simple">
-<li>Twitter: <a class="reference external" href="https://twitter.com/mathwithpython">@mathwithpython</a></li>
-<li>Email : <a class="reference external" href="mailto:doingmathwithpython@gmail.com">doingmathwithpython@gmail.com</a></li>
-</ul>
-</div>
-All chapters completed, off to the printers2015-08-15T23:27:00+10:002015-08-15T23:27:00+10:00Amit Sahatag:doingmathwithpython.github.io,2015-08-15:/off-to-printers.html<p class="first last">off to printers!</p>
-<p>I am very excited to write that all the chapters has been completed
-and the book is currently with the printers! You can find out more
-about the contents (including a detailed table of contents) from the
-<a class="reference external" href="http://doingmathwithpython.github.io/pages/about.html">About</a> page.</p>
-<p>You can stay connected with the book, its readers and me via the
-following channels:</p>
-<ul class="simple">
-<li><a class="reference external" href="https://www.facebook.com/doingmathwithpython">Facebook page</a></li>
-<li><a class="reference external" href="https://plus.google.com/u/0/communities/113121562865298236232">G+ Community</a></li>
-<li><a class="reference external" href="https://twitter.com/mathwithpython">Twitter</a></li>
-</ul>
-Introduction to "Doing Math with Python"2015-05-24T23:27:00+10:002015-05-24T23:27:00+10:00Amit Sahatag:doingmathwithpython.github.io,2015-05-24:/hello-world.html<p class="first last">Hello World</p>
-<p>Hi all, this is the blog for my book "Doing Math with Python".</p>
-<a class="reference external image-reference" href="http://www.nostarch.com/doingmathwithpython"><img alt="Book cover" class="align-center" src="http://doingmathwithpython.github.io/images/cover.png" /></a>
-<p>The first six chapters of the book are already available via the
-publisher's early access program. You can learn briefly about each
-chapter on the <a class="reference external" href="http://doingmathwithpython.github.io/pages/about.html">About</a> page.
-Going forward, I will be sharing updates regarding the book and posting
-original content related to that discussed in the book.</p>
-<p>You can stay connected with the book, its readers and me via the
-following channels:</p>
-<ul class="simple">
-<li><a class="reference external" href="https://www.facebook.com/doingmathwithpython">Facebook page</a></li>
-<li><a class="reference external" href="https://plus.google.com/u/0/communities/113121562865298236232">G+ Community</a></li>
-<li><a class="reference external" href="https://twitter.com/mathwithpython">Twitter</a></li>
-</ul>
-
\ No newline at end of file
diff --git a/feeds/amit-saha.rss.xml b/feeds/amit-saha.rss.xml
deleted file mode 100644
index dc03784..0000000
--- a/feeds/amit-saha.rss.xml
+++ /dev/null
@@ -1,33 +0,0 @@
-
-Doing Math with Python - Amit Sahahttp://doingmathwithpython.github.io/Wed, 25 Oct 2023 13:20:00 +1000Doing Math with Python in Data Science Humble Bundlehttp://doingmathwithpython.github.io/humble-bundle-data-science.html<p class="first last">Humble bundle</p>
-Amit SahaWed, 25 Oct 2023 13:20:00 +1000tag:doingmathwithpython.github.io,2023-10-25:/humble-bundle-data-science.htmlupdatesChapter 3 - Google Correlate example updatehttp://doingmathwithpython.github.io/chapter-3-google-correlate-example-update.html<p>In Chapter 3 on Page 87, the book refers to the Google Correlate service. However, as of December 2019, the service has been shutdown.
-Since the chapter requires you to download a CSV formatted data, it is no longer possible. However, you can instead download a version of
-the data …</p>Amit SahaSat, 11 Jul 2020 00:00:00 +1000tag:doingmathwithpython.github.io,2020-07-11:/chapter-3-google-correlate-example-update.htmlupdatesCoding Starter Kit Humble Bundlehttp://doingmathwithpython.github.io/humble-bundle-coding-starter.html<p>I am very excited to share that "Doing Math with Python" is part of No Starch Press's <a class="reference external" href="https://www.humblebundle.com/books/coding-starter-kit-no-starch-press-books?mc_cid=01272437d1&mc_eid=a8fa0cb420">Coding Starter Humble Bundle</a>.
-Of course, you get No Starch Press's other excellent coding books as part of the bundle.</p>
-<p>It's on for the next 20 days!</p>
-<div class="figure align-left">
-<img alt="Humble Bundle" src="http://doingmathwithpython.github.io/images/coding-starter-humble-bundle.png" />
-</div>
-<p>Your purchases will help support the …</p>Amit SahaTue, 17 Mar 2020 00:00:00 +1000tag:doingmathwithpython.github.io,2020-03-17:/humble-bundle-coding-starter.htmlupdatesNumber of trailing zeros in the factorial of an integerhttp://doingmathwithpython.github.io/trailing-zeros-factorial.html<p class="first last">Use Python to find the number of trailing zeros in the factorial of an integer</p>
-Amit SahaThu, 02 Jan 2020 19:50:00 +1000tag:doingmathwithpython.github.io,2020-01-02:/trailing-zeros-factorial.htmlarticlesDoing Math with Python in Python Humble Bundlehttp://doingmathwithpython.github.io/humble-bundle-python.html<p class="first last">Humble bundle Python</p>
-Amit SahaFri, 23 Aug 2019 00:00:00 +1000tag:doingmathwithpython.github.io,2019-08-23:/humble-bundle-python.htmlupdatesDoing Math with Python in Coder's Bookshelf Humble Bundlehttp://doingmathwithpython.github.io/humble-bundle-coders-bookshelf.html<p class="first last">Humble bundle</p>
-Amit SahaFri, 29 Mar 2019 00:00:00 +1000tag:doingmathwithpython.github.io,2019-03-29:/humble-bundle-coders-bookshelf.htmlupdatesDoing Math with Python in Linux Geek Humble Bundlehttp://doingmathwithpython.github.io/humble-bundle-linux-geek.html<p class="first last">Humble bundle</p>
-Amit SahaTue, 24 Jul 2018 13:20:00 +1000tag:doingmathwithpython.github.io,2018-07-24:/humble-bundle-linux-geek.htmlupdatesAnaconda 5.0 releasehttp://doingmathwithpython.github.io/anaconda-5.0.html<p class="first last">Anaconda 5.0 release</p>
-Amit SahaSun, 29 Oct 2017 19:50:00 +1000tag:doingmathwithpython.github.io,2017-10-29:/anaconda-5.0.htmlupdatesDoing Math with Python Humble Bundlehttp://doingmathwithpython.github.io/humble-bundle.html<p class="first last">Humble bundle</p>
-Amit SahaThu, 06 Apr 2017 08:20:00 +1000tag:doingmathwithpython.github.io,2017-04-06:/humble-bundle.htmlupdatesTrying out the code on Ubuntu 16.04http://doingmathwithpython.github.io/install-on-ubuntu16.04.html<p class="first last">Code on Ubuntu 15.04</p>
-Amit SahaWed, 05 Oct 2016 09:00:00 +1000tag:doingmathwithpython.github.io,2016-10-05:/install-on-ubuntu16.04.htmltipsVideo: Doing Math with Pythonhttp://doingmathwithpython.github.io/video-pyconau-dmwp.html<p class="first last">PyConAU2016</p>
-Amit SahaTue, 16 Aug 2016 12:00:00 +1000tag:doingmathwithpython.github.io,2016-08-16:/video-pyconau-dmwp.htmlupdatesPyCon Australia 2016 Education Seminarhttp://doingmathwithpython.github.io/pycon-au-edu-summit-talk.html<p class="first last">PyCon AU education summit talk</p>
-Amit SahaFri, 12 Aug 2016 11:27:00 +1000tag:doingmathwithpython.github.io,2016-08-12:/pycon-au-edu-summit-talk.htmlupdatesPyCon Australia 2016 Education Seminar: Doing Math with Pythonhttp://doingmathwithpython.github.io/pyconau-dmwp.html<p class="first last">PyConAU2016</p>
-Amit SahaSat, 06 Aug 2016 18:00:00 +1000tag:doingmathwithpython.github.io,2016-08-06:/pyconau-dmwp.htmlupdatesO'Reilly Webcast: Doing Math with Pythonhttp://doingmathwithpython.github.io/oreilly-webcast-doing-math.html<p class="first last">O'Reilly Webcast</p>
-Amit SahaFri, 01 Jul 2016 14:00:00 +1000tag:doingmathwithpython.github.io,2016-07-01:/oreilly-webcast-doing-math.htmlupdatesPython 2016 Education Summit Noteshttp://doingmathwithpython.github.io/education-summit-pycon-2016.html<p class="first last">Education Summit Summary</p>
-Amit SahaSun, 29 May 2016 17:00:00 +1000tag:doingmathwithpython.github.io,2016-05-29:/education-summit-pycon-2016.htmlupdatesPyCon Education Summit Talkhttp://doingmathwithpython.github.io/pycon-edu-summit-talk.html<p class="first last">PyCon education summit talk</p>
-Amit SahaThu, 26 May 2016 11:27:00 +1000tag:doingmathwithpython.github.io,2016-05-26:/pycon-edu-summit-talk.htmlupdatesSymPy 1.0 and Anaconda 4.0 releaseshttp://doingmathwithpython.github.io/sympy-1.0-anaconda-4.0.html<p class="first last">sympy 1.0 and Anaconda 4.0</p>
-Amit SahaMon, 11 Apr 2016 19:50:00 +1000tag:doingmathwithpython.github.io,2016-04-11:/sympy-1.0-anaconda-4.0.htmlupdatesWhat readers are sayinghttp://doingmathwithpython.github.io/what-readers-are-saying.html<p class="first last">Reviews of Doing Math with Python</p>
-Amit SahaSun, 14 Feb 2016 10:00:00 +1000tag:doingmathwithpython.github.io,2016-02-14:/what-readers-are-saying.htmlupdatesTrying out the solutions in IDLEhttp://doingmathwithpython.github.io/trying-out-solutions.html<p class="first last">Trying out the solutions</p>
-Amit SahaWed, 18 Nov 2015 08:20:00 +1000tag:doingmathwithpython.github.io,2015-11-18:/trying-out-solutions.htmlupdatesBreaking long lines in Pythonhttp://doingmathwithpython.github.io/breaking-long-lines-in-python.html<p class="first last">Breaking long lines in Python</p>
-Amit SahaWed, 04 Nov 2015 12:00:00 +1000tag:doingmathwithpython.github.io,2015-11-04:/breaking-long-lines-in-python.htmlarticlesChapter code and Erratahttp://doingmathwithpython.github.io/chapter-code-errata.html<p class="first last">Chapter code and errata</p>
-Amit SahaFri, 11 Sep 2015 08:20:00 +1000tag:doingmathwithpython.github.io,2015-09-11:/chapter-code-errata.htmlupdatesSet operations with Python set compared to SymPy's FiniteSethttp://doingmathwithpython.github.io/Sets-in-SymPy-and-built-in-Python-sets.html<p class="first last">Sets in SymPy and built-in Python sets</p>
-Amit SahaSat, 05 Sep 2015 23:00:00 +1000tag:doingmathwithpython.github.io,2015-09-05:/Sets-in-SymPy-and-built-in-Python-sets.htmlarticlesDoing Math with Python Available now!http://doingmathwithpython.github.io/available-now.html<p class="first last">Available now!</p>
-Amit SahaWed, 02 Sep 2015 08:00:00 +1000tag:doingmathwithpython.github.io,2015-09-02:/available-now.htmlupdatesAll chapters completed, off to the printershttp://doingmathwithpython.github.io/off-to-printers.html<p class="first last">off to printers!</p>
-Amit SahaSat, 15 Aug 2015 23:27:00 +1000tag:doingmathwithpython.github.io,2015-08-15:/off-to-printers.htmlupdatesIntroduction to "Doing Math with Python"http://doingmathwithpython.github.io/hello-world.html<p class="first last">Hello World</p>
-Amit SahaSun, 24 May 2015 23:27:00 +1000tag:doingmathwithpython.github.io,2015-05-24:/hello-world.htmlupdates
\ No newline at end of file
diff --git a/feeds/articles.atom.xml b/feeds/articles.atom.xml
deleted file mode 100644
index 0e097c7..0000000
--- a/feeds/articles.atom.xml
+++ /dev/null
@@ -1,384 +0,0 @@
-
-Doing Math with Python - articleshttp://doingmathwithpython.github.io/2020-01-02T19:50:00+10:00Number of trailing zeros in the factorial of an integer2020-01-02T19:50:00+10:002020-01-02T19:50:00+10:00Amit Sahatag:doingmathwithpython.github.io,2020-01-02:/trailing-zeros-factorial.html<p class="first last">Use Python to find the number of trailing zeros in the factorial of an integer</p>
-<p>I recently learned about a cool formula to calculate the number of
-trailing zeros in the factorial of a number. It has been a while since I
-wrote a program to do something like this. So, I decided to change that and
-write this blog post. Let's jump in.</p>
-<p>In the spirit of wring various "calculators" in the book, we will
-write a "number of trailing zero" calculator. First up though, let's refresh
-some key relevant concepts.</p>
-<p><strong>Factorial</strong>: The factorial of a number, <tt class="docutils literal">n</tt> denoted by <tt class="docutils literal">n!</tt> is the product <tt class="docutils literal"><span class="pre">n*(n-1)*(n-2)...*1</span></tt>.
-For example, <tt class="docutils literal">5! = 5*4*3*2*1 = 120</tt>.</p>
-<p><strong>Trailing zeros</strong>: The trailing zeros of a number is the number of zeros at the end of a number. For example,
-the number 567100 has <strong>two</strong> trailing zeros.</p>
-<p><strong>Floor</strong>: The floor of a number is the greatest integer less than or equal to x. That is floor of 3.2 is 3
-and that of 3.5 is 3 and the floor of 3 is 3 as well.</p>
-<p>Now, coming back to the focus of this post, this document at brilliant.org wiki
-explains the process in <a class="reference external" href="https://brilliant.org/wiki/trailing-number-of-zeros/">detail</a>.</p>
-<p>The key bit there in is this formula:</p>
-<div class="figure">
-<img alt="" src="http://doingmathwithpython.github.io/images/trailing_zeros_formula.png" />
-</div>
-<p>where, <tt class="docutils literal">n</tt> is the number for whose factorial we want to find the number of trailing zeros.</p>
-<p>The following Python program implements the above formula:</p>
-<pre class="code literal-block">
-import math
-
-
-def is_positive_integer(x):
- try:
- x = float(x)
- except ValueError:
- return False
- else:
- if x.is_integer() and x > 0:
- return True
- else:
- return False
-
-
-def trailing_zeros(num):
- if is_positive_integer(num):
- # The above function call has done all the sanity checks for us
- # so we can just convert this into an integer here
- num = int(num)
-
- k = math.floor(math.log(num, 5))
- zeros = 0
- for i in range(1, k + 1):
- zeros = zeros + math.floor(num/math.pow(5, i))
- return zeros
- else:
- print("Factorial of a non-positive non-integer is undefined")
-
-
-if __name__ == "__main__":
- fact_num = input(
- "Enter the number whose factorial's trailing zeros you want to find: "
- )
- num_zeros = trailing_zeros(fact_num)
- print("Number of trailing zeros: {0}".format(num_zeros))
-</pre>
-<p>When we run this program using Python 3, it will ask for the number whose factorial's number of trailing
-zeros we want to find and then print it out, like so:</p>
-<pre class="code literal-block">
-Enter the number whose factorial's trailing zeros you want to find: 5
-Number of trailing zeros: 1
-</pre>
-<p>If you enter a number which is not a positive integer, you will get an error message:</p>
-<pre class="code literal-block">
-Enter the number whose factorial's trailing zeros you want to find: 5.1
-Factorial of a non-positive integer is undefined
-Number of trailing zeros: None
-</pre>
-<p>Some key standard library functions we use in the above program are:</p>
-<ul class="simple">
-<li><tt class="docutils literal">math.floor</tt>: This function is used to find the floor of a number</li>
-<li><tt class="docutils literal">math.log</tt>: This function is used to find the logarithm of a number for a specified base (defaults to 10)</li>
-<li><tt class="docutils literal">math.pow</tt>: This function is used to find out the power of a number raised to another</li>
-</ul>
-<p>The above functions are defined in the <a class="reference external" href="https://docs.python.org/3/library/math.html">math module</a>.</p>
-<p>Besides the above, we use the <cite>is_integer()</cite> function defined on a floating point object to check
-if the floating point object is actually an integer.</p>
-<p>The latest version of the code is available <a class="reference external" href="https://github.com/doingmathwithpython/code/blob/master/explorations/trailing_zeros/trailing_zeros.py">here</a>.</p>
-Breaking long lines in Python2015-11-04T12:00:00+10:002015-11-04T12:00:00+10:00Amit Sahatag:doingmathwithpython.github.io,2015-11-04:/breaking-long-lines-in-python.html<p class="first last">Breaking long lines in Python</p>
-<p>In some of the programs discussed in the book including the sample solutions, you will see statements like:</p>
-<pre class="code literal-block">
-print('Area: {0}, Estimated ({1}): {2}'.
- format(area_of_circle, points, estimate(radius, points)))
-</pre>
-<p>This is really the following single statement:</p>
-<pre class="code literal-block">
-print('Area: {0}, Estimated ({1}): {2}'.format(area_of_circle, points, estimate(radius, points)))
-</pre>
-<p>The first code snippet above is an example of breaking a long line into two (or more) lines so that we don't end up with really long lines in our code. How long should a line be when you should think about breaking it? If your statement's length is more than 80 characters, you should think about breaking it up.</p>
-<p>In the book, we often had to do so because of layout reasons even though the statement may not have exceeded 80 characters, and in your projects you will want to do it so that your statements are easier to read and on the average all lines have a similar length. This is formalized (among other things) in <a class="reference external" href="https://www.python.org/dev/peps/pep-0008/">PEP 8</a>.</p>
-<p>Note that the examples below will for illustrative purposes break lines waaaaay less than 80 characters.</p>
-<div class="section" id="how-do-you-break">
-<h2>How do you break?</h2>
-<div class="section" id="when-not-calling-function">
-<h3>When not calling function</h3>
-<p>When you are not calling a function, you essentially have two choices:</p>
-<p><strong>Use paranthesis</strong></p>
-<p>This is exactly how we break the long statement in the example we started this article with. For the moment ignore the call to <tt class="docutils literal">print()</tt> and assume that the statement is:</p>
-<pre class="code literal-block">
-s = 'Area: {0}, Estimated ({1}): {2}'.format(area_of_circle, points, estimate(radius, points))
-</pre>
-<p>This essentially just creates the string <tt class="docutils literal">s</tt>. If we were to split this statement over multiple lines, we would do the following:</p>
-<pre class="code literal-block">
-s = ('Area: {0}, Estimated ({1}): {2}'
- .format(area_of_circle, points, estimate(radius, points)))
-</pre>
-<p>Note the extra beginning and the ending parenthesis.</p>
-<p>Here is another example:</p>
-<pre class="code literal-block">
-s1 = x + x**2/2 + x**3/3 + x**4/4 + x**5/5 + x**6/6 + x**7/7 + x**8/8
-</pre>
-<p>Here is how we can use split the above statment into multiple lines using parentheses:</p>
-<pre class="code literal-block">
-s3 = (x + x**2/2 + x**3/3
- + x**4/4 + x**5/5
- + x**6/6 + x**7/7
- + x**8/8)
-</pre>
-<p><strong>Use the line continuation operator</strong></p>
-<p>The line continuation operator, <tt class="docutils literal">\</tt> can be used to split long statements over multiple lines. Here is how we could split the above statement using <tt class="docutils literal">\</tt> instead:</p>
-<pre class="code literal-block">
-s3 = x + x**2/2 + x**3/3 \
- + x**4/4 + x**5/5 \
- + x**6/6 + x**7/7 \
- + x**8/8
-</pre>
-<p>At the end of every line (except the last), we just add a <tt class="docutils literal">\</tt> indicating that the next line is also a part of the same statement.</p>
-<p><strong>Breaking up those long if statements</strong></p>
-<p>Often I have to break long <tt class="docutils literal">if</tt> statements and is in fact one of the most common cases I face at work where I have to break the statement into multiple lines. Here is an example using both the approaches above:</p>
-<pre class="code literal-block">
-# Using parenthesis
-if (cond1 and cond2 and cond3
- and cond4):
- # True block
-else:
- # False block
-
-# Using line continuation operator
-if cond1 and cond2 and cond3 \
- and cond4:
- # True block
-else:
- # False block
-</pre>
-</div>
-<div class="section" id="when-calling-functions">
-<h3>When calling functions</h3>
-<p>By default, when calling functions you can just press enter and without doing anything more keep writing your statement over multiple lines. For example:</p>
-<pre class="code literal-block">
-x = 1
-print(x,
- x)
-</pre>
-<p>Hence, we <cite>could</cite> have broken the first example we saw as:</p>
-<pre class="code literal-block">
-print('Area: {0}, Estimated ({1}): {2}'.format(area_of_circle,
- points,
- estimate(radius, points)))
-</pre>
-<p>When calling <tt class="docutils literal">format()</tt> we put the arguments over separate lines.</p>
-</div>
-</div>
-<div class="section" id="learning-more-about-python-coding-style">
-<h2>Learning more about Python coding style</h2>
-<p>If you liked reading this article, you may also find it worth your time going over the <a class="reference external" href="https://www.python.org/dev/peps/pep-0008/">Python style guide</a>. You may even find instances where I have not followed a guideline when writing the programs in the book. If you find one, let me know.</p>
-</div>
-<div class="section" id="getting-in-touch">
-<h2>Getting in touch</h2>
-<p>Stay updated or get in touch:</p>
-<ul class="simple">
-<li><a class="reference external" href="https://www.facebook.com/doingmathwithpython">Facebook page</a></li>
-<li><a class="reference external" href="https://plus.google.com/u/0/communities/113121562865298236232">G+ Community</a></li>
-<li><a class="reference external" href="https://twitter.com/mathwithpython">Twitter</a></li>
-</ul>
-<p>You can contact me directly via:</p>
-<ul class="simple">
-<li>Twitter: <a class="reference external" href="https://twitter.com/mathwithpython">@mathwithpython</a></li>
-<li>Email : <a class="reference external" href="mailto:doingmathwithpython@gmail.com">doingmathwithpython@gmail.com</a></li>
-</ul>
-</div>
-Set operations with Python set compared to SymPy's FiniteSet2015-09-05T23:00:00+10:002015-09-05T23:00:00+10:00Amit Sahatag:doingmathwithpython.github.io,2015-09-05:/Sets-in-SymPy-and-built-in-Python-sets.html<p class="first last">Sets in SymPy and built-in Python sets</p>
-<p><cite>Chapter 5</cite> (<a class="reference external" href="http://doingmathwithpython.github.io/pages/about.html">About</a>) of the book discusses working with mathematical sets in
-Python. While writing the chapter, I had a choice of whether to
-use Python 3's built-in <a class="reference external" href="https://docs.python.org/3.3/library/stdtypes.html?highlight=union#set-types-set-frozenset">set</a> data
-structure or use SymPy's (0.7.6 +) <tt class="docutils literal">FiniteSet</tt> class. I decided to go ahead
-with the latter. My choice is briefly explained towards the end of
-this post, but hopefully it will be clear before that.</p>
-<p>Next, I describe how you can use Python 3's built-in set data
-structure to create sets and perform set operations such as finding
-the union, intersection or cartesian product of sets. For comparison,
-I also show how you can do the same using SymPy's <tt class="docutils literal">FiniteSet</tt> class.</p>
-<div class="section" id="creating-a-set">
-<h2>Creating a set</h2>
-<p>We can create a set consisting of the elements <cite>{1, 2, 3}</cite> in Python 3
-as follows:</p>
-<div class="highlight"><pre><span></span><span class="o">>>></span> <span class="n">s1</span> <span class="o">=</span> <span class="p">{</span><span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> <span class="mi">3</span><span class="p">}</span>
-<span class="o">>>></span> <span class="n">s1</span>
-<span class="p">{</span><span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> <span class="mi">3</span><span class="p">}</span>
-</pre></div>
-<p>To create a set when the elements are already in a list (for
-example), we would use the following syntax:</p>
-<div class="highlight"><pre><span></span><span class="o">>>></span> <span class="n">items</span> <span class="o">=</span> <span class="p">[</span><span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> <span class="mi">3</span><span class="p">]</span>
-<span class="o">>>></span> <span class="n">s2</span> <span class="o">=</span> <span class="nb">set</span><span class="p">(</span><span class="n">items</span><span class="p">)</span>
-<span class="o">>>></span> <span class="n">s2</span>
-<span class="p">{</span><span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> <span class="mi">3</span><span class="p">}</span>
-</pre></div>
-<p>The comparative operations using SymPy's <tt class="docutils literal">FiniteSet</tt> class are:</p>
-<div class="highlight"><pre><span></span><span class="o">>>></span> <span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">FiniteSet</span>
-<span class="o">>>></span> <span class="n">s1</span> <span class="o">=</span> <span class="n">FiniteSet</span><span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> <span class="mi">3</span><span class="p">)</span>
-<span class="o">>>></span> <span class="n">s1</span>
-<span class="p">{</span><span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> <span class="mi">3</span><span class="p">}</span>
-
-<span class="o">>>></span> <span class="n">items</span> <span class="o">=</span> <span class="p">[</span><span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> <span class="mi">3</span><span class="p">]</span>
-<span class="o">>>></span> <span class="n">s2</span> <span class="o">=</span> <span class="n">FiniteSet</span><span class="p">(</span><span class="o">*</span><span class="n">items</span><span class="p">)</span>
-<span class="o">>>></span> <span class="n">s2</span>
-<span class="p">{</span><span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> <span class="mi">3</span><span class="p">}</span>
-</pre></div>
-<p>To create an <a class="reference external" href="https://en.wikipedia.org/wiki/Empty_set">empty set</a>,
-in Python 3 you would use create an empty <tt class="docutils literal">set</tt> object:</p>
-<div class="highlight"><pre><span></span><span class="o">>>></span> <span class="n">e</span> <span class="o">=</span> <span class="nb">set</span><span class="p">()</span>
-<span class="o">>>></span> <span class="n">e</span>
-<span class="nb">set</span><span class="p">()</span>
-</pre></div>
-<p>In SymPy, an empty set is represented by an <tt class="docutils literal">EmptySet</tt> object. Thus,
-you can either create an empty set by directly creating an
-<tt class="docutils literal">EmptySet</tt> object or by creating a <tt class="docutils literal">FiniteSet</tt> object without
-specifying any set members, like so:</p>
-<div class="highlight"><pre><span></span><span class="o">>>></span> <span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">EmptySet</span>
-<span class="o">>>></span> <span class="n">e</span> <span class="o">=</span> <span class="n">EmptySet</span><span class="p">()</span>
-<span class="o">>>></span> <span class="n">e</span>
-<span class="n">EmptySet</span><span class="p">()</span>
-<span class="o">>>></span> <span class="n">e</span> <span class="o">=</span> <span class="n">FiniteSet</span><span class="p">()</span>
-<span class="o">>>></span> <span class="n">e</span>
-<span class="n">EmptySet</span><span class="p">()</span>
-</pre></div>
-</div>
-<div class="section" id="cardinality-and-membership">
-<h2>Cardinality and Membership</h2>
-<p>The <tt class="docutils literal">len()</tt> function returns the number of set members for sets
-created using either of the above approaches.</p>
-<p>Similarly, to check if an item <tt class="docutils literal">x</tt> is present in a set, <tt class="docutils literal">s</tt>
-created using any of the above approaches, we can use the statement,
-<tt class="docutils literal">x in s</tt>.</p>
-</div>
-<div class="section" id="union-and-intersection">
-<h2>Union and intersection</h2>
-<p>The <tt class="docutils literal">union()</tt> method can be used in both cases to find the union of
-two or more sets:</p>
-<div class="highlight"><pre><span></span><span class="o">>>></span> <span class="n">s1</span> <span class="o">=</span> <span class="nb">set</span><span class="p">([</span><span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> <span class="mi">3</span><span class="p">])</span>
-<span class="o">>>></span> <span class="n">s2</span> <span class="o">=</span> <span class="nb">set</span><span class="p">([</span><span class="mi">2</span><span class="p">,</span> <span class="mi">3</span><span class="p">,</span> <span class="mi">4</span><span class="p">])</span>
-<span class="o">>>></span> <span class="n">s3</span> <span class="o">=</span> <span class="nb">set</span><span class="p">([</span><span class="mi">2</span><span class="p">,</span> <span class="mi">3</span><span class="p">,</span> <span class="mi">4</span><span class="p">,</span> <span class="mi">5</span><span class="p">])</span>
-<span class="o">>>></span> <span class="n">s1</span><span class="o">.</span><span class="n">union</span><span class="p">(</span><span class="n">s2</span><span class="p">)</span><span class="o">.</span><span class="n">union</span><span class="p">(</span><span class="n">s3</span><span class="p">)</span>
-<span class="p">{</span><span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> <span class="mi">3</span><span class="p">,</span> <span class="mi">4</span><span class="p">,</span> <span class="mi">5</span><span class="p">}</span>
-</pre></div>
-<p>Similary in the case of SymPy:</p>
-<div class="highlight"><pre><span></span><span class="o">>>></span> <span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">FiniteSet</span>
-<span class="o">>>></span> <span class="n">s1</span> <span class="o">=</span> <span class="n">FiniteSet</span><span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> <span class="mi">3</span><span class="p">)</span>
-<span class="o">>>></span> <span class="n">s2</span> <span class="o">=</span> <span class="n">FiniteSet</span><span class="p">(</span><span class="mi">2</span><span class="p">,</span> <span class="mi">3</span><span class="p">,</span> <span class="mi">4</span><span class="p">)</span>
-<span class="o">>>></span> <span class="n">s3</span> <span class="o">=</span> <span class="n">FiniteSet</span><span class="p">(</span><span class="mi">2</span><span class="p">,</span> <span class="mi">3</span><span class="p">,</span> <span class="mi">4</span><span class="p">,</span> <span class="mi">5</span><span class="p">)</span>
-<span class="o">>>></span> <span class="n">s1</span><span class="o">.</span><span class="n">union</span><span class="p">(</span><span class="n">s2</span><span class="p">)</span><span class="o">.</span><span class="n">union</span><span class="p">(</span><span class="n">s3</span><span class="p">)</span>
-<span class="p">{</span><span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> <span class="mi">3</span><span class="p">,</span> <span class="mi">4</span><span class="p">,</span> <span class="mi">5</span><span class="p">}</span>
-</pre></div>
-<p>The <tt class="docutils literal">intersection()</tt> method can be used to find the intersection of
-two or more sets created using either of the above approaches. Continuing
-with the above three sets:</p>
-<div class="highlight"><pre><span></span><span class="o">>>></span> <span class="n">s1</span> <span class="o">=</span> <span class="nb">set</span><span class="p">([</span><span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> <span class="mi">3</span><span class="p">])</span>
-<span class="o">>>></span> <span class="n">s2</span> <span class="o">=</span> <span class="nb">set</span><span class="p">([</span><span class="mi">2</span><span class="p">,</span> <span class="mi">3</span><span class="p">,</span> <span class="mi">4</span><span class="p">])</span>
-<span class="o">>>></span> <span class="n">s3</span> <span class="o">=</span> <span class="nb">set</span><span class="p">([</span><span class="mi">2</span><span class="p">,</span> <span class="mi">3</span><span class="p">,</span> <span class="mi">4</span><span class="p">,</span> <span class="mi">5</span><span class="p">])</span>
-<span class="o">>>></span> <span class="n">s1</span><span class="o">.</span><span class="n">intersection</span><span class="p">(</span><span class="n">s2</span><span class="p">)</span><span class="o">.</span><span class="n">intersection</span><span class="p">(</span><span class="n">s3</span><span class="p">)</span>
-<span class="p">{</span><span class="mi">2</span><span class="p">,</span> <span class="mi">3</span><span class="p">}</span>
-</pre></div>
-<p>Similary, in SymPy:</p>
-<div class="highlight"><pre><span></span><span class="o">>>></span> <span class="n">s1</span><span class="o">.</span><span class="n">intersection</span><span class="p">(</span><span class="n">s2</span><span class="p">)</span><span class="o">.</span><span class="n">intersection</span><span class="p">(</span><span class="n">s3</span><span class="p">)</span>
-<span class="p">{</span><span class="mi">2</span><span class="p">,</span> <span class="mi">3</span><span class="p">}</span>
-</pre></div>
-</div>
-<div class="section" id="cartesian-product">
-<h2>Cartesian product</h2>
-<p>To find the cartesian product of sets created via the built-in <tt class="docutils literal">set</tt>
-data structure, we have to use the <tt class="docutils literal">product()</tt> function in the
-<a class="reference external" href="https://docs.python.org/3/library/itertools.html#itertools.product">itertools</a>
-module:</p>
-<div class="highlight"><pre><span></span><span class="o">>>></span> <span class="n">s1</span> <span class="o">=</span> <span class="p">{</span><span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> <span class="mi">3</span><span class="p">}</span>
-<span class="o">>>></span> <span class="n">s2</span> <span class="o">=</span> <span class="p">{</span><span class="mi">4</span><span class="p">,</span> <span class="mi">5</span><span class="p">,</span> <span class="mi">6</span><span class="p">}</span>
-<span class="o">>>></span> <span class="kn">import</span> <span class="nn">itertools</span>
-<span class="o">>>></span> <span class="n">itertools</span><span class="o">.</span><span class="n">product</span><span class="p">(</span><span class="n">s1</span><span class="p">,</span> <span class="n">s2</span><span class="p">)</span>
-<span class="o"><</span><span class="n">itertools</span><span class="o">.</span><span class="n">product</span> <span class="nb">object</span> <span class="n">at</span> <span class="mh">0x10418c990</span><span class="o">></span>
-</pre></div>
-<p>However considering that the <cite>cartesian product</cite> of two sets <a class="reference external" href="http://mathinsight.org/definition/cartesian_product">should</a> be another set,
-the <tt class="docutils literal">product()</tt> function doesn't really then return the
-cartesian product itself, but (an iterator to) the elements in it. Hence, if we
-try to apply the result returned by the function directly to a method or
-function which is expected to be applicable to a set, it will fail. For
-example, <tt class="docutils literal">itertools.product(s1, <span class="pre">s2).union(s3)</span></tt> will result in an error, but
-<tt class="docutils literal">set(itertools.product(s1, <span class="pre">s2)).union(s3)</span></tt> will work.</p>
-<p>Using SymPy's <tt class="docutils literal">FiniteSet</tt>, you can use the <tt class="docutils literal">*</tt>
-(multiplication or product) operator to find the cartesian product
-and the result is a set itself. Thus, it is closer to what
-a cartesian product is mathematically. An example follows:</p>
-<div class="highlight"><pre><span></span><span class="o">>>></span> <span class="n">s1</span> <span class="o">=</span> <span class="n">FiniteSet</span><span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> <span class="mi">3</span><span class="p">)</span>
-<span class="o">>>></span> <span class="n">s2</span> <span class="o">=</span> <span class="n">FiniteSet</span><span class="p">(</span><span class="mi">4</span><span class="p">,</span> <span class="mi">5</span><span class="p">,</span> <span class="mi">6</span><span class="p">)</span>
-<span class="o">>>></span> <span class="o">>>></span> <span class="n">s3</span> <span class="o">=</span> <span class="n">FiniteSet</span><span class="p">(</span><span class="mi">7</span><span class="p">,</span> <span class="mi">8</span><span class="p">,</span> <span class="mi">9</span><span class="p">)</span>
-<span class="o">>>></span> <span class="p">(</span><span class="n">s1</span><span class="o">*</span><span class="n">s2</span><span class="p">)</span><span class="o">.</span><span class="n">union</span><span class="p">(</span><span class="n">s3</span><span class="p">)</span>
-<span class="p">{</span><span class="mi">7</span><span class="p">,</span> <span class="mi">8</span><span class="p">,</span> <span class="mi">9</span><span class="p">}</span> <span class="n">U</span> <span class="p">{</span><span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> <span class="mi">3</span><span class="p">}</span> <span class="n">x</span> <span class="p">{</span><span class="mi">4</span><span class="p">,</span> <span class="mi">5</span><span class="p">,</span> <span class="mi">6</span><span class="p">}</span>
-</pre></div>
-<p><strong>Cartesian product of a set with itself</strong></p>
-<p>To find the cartesian product of a set with itself, i.e. <cite>s1*s1</cite> for
-example, we pass in a keyword argument, <tt class="docutils literal">repeat</tt> while calling the
-<tt class="docutils literal">itertools.product()</tt> function. The value of <tt class="docutils literal">repeat</tt> is the
-<cite>power</cite> we want to raise the set to. Thus, <tt class="docutils literal">itertools.product(s1,
-repeat=2)</tt> will calculate the cartesian product, <cite>s1*s1</cite>:</p>
-<div class="highlight"><pre><span></span><span class="o">>>></span> <span class="n">s1</span> <span class="o">=</span> <span class="p">{</span><span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> <span class="mi">3</span><span class="p">}</span>
-<span class="o">>>></span> <span class="nb">set</span><span class="p">(</span><span class="n">itertools</span><span class="o">.</span><span class="n">product</span><span class="p">(</span><span class="n">s1</span><span class="p">,</span> <span class="n">repeat</span><span class="o">=</span><span class="mi">2</span><span class="p">))</span>
-<span class="p">{(</span><span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">),</span> <span class="p">(</span><span class="mi">3</span><span class="p">,</span> <span class="mi">2</span><span class="p">),</span> <span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="mi">3</span><span class="p">),</span> <span class="p">(</span><span class="mi">3</span><span class="p">,</span> <span class="mi">3</span><span class="p">),</span> <span class="p">(</span><span class="mi">3</span><span class="p">,</span> <span class="mi">1</span><span class="p">),</span> <span class="p">(</span><span class="mi">2</span><span class="p">,</span> <span class="mi">1</span><span class="p">),</span> <span class="p">(</span><span class="mi">2</span><span class="p">,</span> <span class="mi">3</span><span class="p">),</span> <span class="p">(</span><span class="mi">2</span><span class="p">,</span> <span class="mi">2</span><span class="p">),</span> <span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="mi">1</span><span class="p">)}</span>
-</pre></div>
-<p>In SymPy, the <tt class="docutils literal">**</tt> operator can be used for finding the cartesian
-product of a set with itself:</p>
-<div class="highlight"><pre><span></span><span class="o">>>></span> <span class="n">s1</span> <span class="o">=</span> <span class="n">FiniteSet</span><span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> <span class="mi">3</span><span class="p">)</span>
-<span class="o">>>></span> <span class="n">s1</span><span class="o">**</span><span class="mi">2</span>
-<span class="p">{</span><span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> <span class="mi">3</span><span class="p">}</span> <span class="n">x</span> <span class="p">{</span><span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> <span class="mi">3</span><span class="p">}</span>
-</pre></div>
-</div>
-<div class="section" id="subset-super-set-proper-subset-checking">
-<h2>Subset/super set/proper subset checking</h2>
-<p>The <tt class="docutils literal">issubset()</tt> and <tt class="docutils literal">issuperset()</tt> methods are available for sets
-created via either approaches to check if a set is a subset and super
-set of another, respectively. Thus, <tt class="docutils literal">s1.issubset(s2)</tt> will check if
-<cite>s1</cite> is a subset of <cite>s2</cite>.</p>
-<p><strong>Checking for proper subset and superset</strong></p>
-<p>To check if a set, <cite>s1</cite> is a <a class="reference external" href="http://mathworld.wolfram.com/ProperSubset.html">proper subset</a> of another set,
-<cite>s2</cite> when using built-in set, we can do the following:</p>
-<div class="highlight"><pre><span></span><span class="o">>>></span> <span class="n">s1</span> <span class="o">=</span> <span class="p">{</span><span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> <span class="mi">3</span><span class="p">}</span>
-<span class="o">>>></span> <span class="n">s2</span> <span class="o">=</span> <span class="p">{</span><span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> <span class="mi">3</span><span class="p">,</span> <span class="mi">4</span><span class="p">}</span>
-<span class="o">>>></span> <span class="n">s1</span><span class="o">.</span><span class="n">issubset</span><span class="p">(</span><span class="n">s2</span><span class="p">)</span> <span class="ow">and</span> <span class="n">s1</span> <span class="o">!=</span> <span class="n">s2</span>
-<span class="kc">True</span>
-</pre></div>
-<p>We can do something similar for <a class="reference external" href="http://mathinsight.org/definition/proper_superset">proper superset</a>.</p>
-<p>In SymPy, we have <tt class="docutils literal">is_proper_subset()</tt> and <tt class="docutils literal">is_proper_superset()</tt>
-methods which can be used to check if a set is a proper subset or
-superset of another, respectively. Thus, the above would be written as
-<tt class="docutils literal">s1.is_proper_subset(s2)</tt>.</p>
-</div>
-<div class="section" id="calculating-the-powerset">
-<h2>Calculating the powerset</h2>
-<p>For sets created via built-in <tt class="docutils literal">set</tt> data structure, there is no
-direct method available to create the <a class="reference external" href="https://www.mathsisfun.com/sets/power-set.html">power set</a>. However, you can use the
-<tt class="docutils literal">powerset</tt> recipe described in the <a class="reference external" href="https://docs.python.org/3/library/itertools.html#recipes">itertools documentation</a>.</p>
-<p>On the other hand, in SymPy, there is a <tt class="docutils literal">powerset()</tt> method
-available which returns the power set:</p>
-<div class="highlight"><pre><span></span><span class="o">>>></span> <span class="n">s1</span> <span class="o">=</span> <span class="n">FiniteSet</span><span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> <span class="mi">3</span><span class="p">)</span>
-<span class="o">>>></span> <span class="n">s1</span><span class="o">.</span><span class="n">powerset</span><span class="p">()</span>
-<span class="p">{</span><span class="n">EmptySet</span><span class="p">(),</span> <span class="p">{</span><span class="mi">1</span><span class="p">},</span> <span class="p">{</span><span class="mi">2</span><span class="p">},</span> <span class="p">{</span><span class="mi">3</span><span class="p">},</span> <span class="p">{</span><span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">},</span> <span class="p">{</span><span class="mi">1</span><span class="p">,</span> <span class="mi">3</span><span class="p">},</span> <span class="p">{</span><span class="mi">2</span><span class="p">,</span> <span class="mi">3</span><span class="p">},</span> <span class="p">{</span><span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> <span class="mi">3</span><span class="p">}}</span>
-</pre></div>
-<p>You can see that the <tt class="docutils literal">powerset()</tt> method returns the power <cite>set</cite> and not the
-elements in it.</p>
-</div>
-<div class="section" id="choice-of-sympy-s-finiteset-over-set">
-<h2>Choice of SymPy's <tt class="docutils literal">FiniteSet</tt> over <tt class="docutils literal">set</tt></h2>
-<p>From the above comparison, we can see that SymPy's <tt class="docutils literal">FiniteSet</tt>
-provides us with nice features such as being able to use the <tt class="docutils literal">*</tt>
-operator to find the cartesian product, <tt class="docutils literal">**</tt> operator to calculate
-the cartesian product with itself and <tt class="docutils literal">powerset()</tt> method for calculating the
-power set. These are not present when using the built-in <tt class="docutils literal">set</tt> data
-structure. This was certainly a big driving factor in my choice,
-since SymPy was also being used in other chapters of the book.</p>
-<p>However, a <em>key</em> reason for my choice was that I wanted to show how we
-can create sets which did not allow addition or removal once created -
-like mathematical sets. This need was fulfilled by SymPy's
-<tt class="docutils literal">FiniteSet</tt> since it used Python's <tt class="docutils literal">frozenset</tt> data structure and
-not the <tt class="docutils literal">set</tt> data sturcture.</p>
-<p>The alternative to that would have
-been to use <tt class="docutils literal">frozenset</tt> directly, but I just did not like the idea
-of it and I would have also missed out on the nice features
-<tt class="docutils literal">FiniteSet</tt> would provide (eventually). I should note here that once
-I had made the decision to go with <tt class="docutils literal">FiniteSet</tt>, I <a class="reference external" href="https://github.com/amitsaha/sympy/commits?author=amitsaha">contributed</a> patches
-to SymPy to make the methods of <tt class="docutils literal">FiniteSet</tt> more compatible with Python's built in set
-and also implement minor features I discussed above.</p>
-</div>
-
\ No newline at end of file
diff --git a/feeds/tips.atom.xml b/feeds/tips.atom.xml
deleted file mode 100644
index fcaf5e5..0000000
--- a/feeds/tips.atom.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-
-Doing Math with Python - tipshttp://doingmathwithpython.github.io/2016-10-05T09:00:00+10:00Trying out the code on Ubuntu 16.042016-10-05T09:00:00+10:002016-10-05T09:00:00+10:00Amit Sahatag:doingmathwithpython.github.io,2016-10-05:/install-on-ubuntu16.04.html<p class="first last">Code on Ubuntu 15.04</p>
-<p>If you are using Ubuntu 16.04 and don't want to install the Anaconda
-Python distribution for trying out the book's
-<a class="reference external" href="http://doingmathwithpython.github.io/pages/programs.html">programs</a> or
-the <a class="reference external" href="http://doingmathwithpython.github.io/trying-out-solutions.html">sample solutions</a>, this
-post is for you.</p>
-<p>Ubuntu 16.04 already comes with Python 3 installed, so we only need to install
-the following packages - matplotlib, matplotlib-venn, sympy and idle3.</p>
-<p>Open a terminal and do the following:</p>
-<pre class="code literal-block">
-$ sudo apt-get update
-$ sudo apt-get install python3-matplotlib python3-matplotlib-venn python3-sympy idle3
-</pre>
-<p>It's worth noting that this will install sympy 0.7.6 and matplotlib 1.5.1 which are
-both sufficient for the book's programs.</p>
-<div class="section" id="starting-idle-editor">
-<h2>Starting IDLE editor</h2>
-<p>You can now start the IDLE editor by typing in "idle3" from the terminal and then it's ready
-for your programs!</p>
-</div>
-<div class="section" id="contact">
-<h2>Contact</h2>
-<p>If you find any issues please email me at
-<tt class="docutils literal">doingmathwithpython@gmail.com</tt> or post your query/tip to any of the
-following community forums:</p>
-<ul class="simple">
-<li><a class="reference external" href="https://www.facebook.com/doingmathwithpython">Facebook page</a></li>
-<li><a class="reference external" href="https://plus.google.com/u/0/communities/113121562865298236232">G+ Community</a></li>
-</ul>
-</div>
-
\ No newline at end of file
diff --git a/feeds/updates.atom.xml b/feeds/updates.atom.xml
deleted file mode 100644
index c609e7f..0000000
--- a/feeds/updates.atom.xml
+++ /dev/null
@@ -1,443 +0,0 @@
-
-Doing Math with Python - updateshttp://doingmathwithpython.github.io/2023-10-25T13:20:00+10:00Doing Math with Python in Data Science Humble Bundle2023-10-25T13:20:00+10:002023-10-25T13:20:00+10:00Amit Sahatag:doingmathwithpython.github.io,2023-10-25:/humble-bundle-data-science.html<p class="first last">Humble bundle</p>
-<p>"Doing Math with Python" is part of No Starch Press's <a class="reference external" href="https://www.humblebundle.com/books/data-science-no-starch-press-books">Data Science Humble Bundle</a>
-running for the next 19 days. Your purchases will help support EFF!</p>
-<div class="figure align-center">
-<img alt="Humble Bundle" src="http://doingmathwithpython.github.io/images/data-science-humble-bundle.png" />
-</div>
-<p>Get the bundle <a class="reference external" href="https://www.humblebundle.com/books/data-science-no-starch-press-books">here</a>!</p>
-<p>I am still surprised that the book still continues to be relevant, and i am quietly happy that I could produce such a book,
-thanks to all the help i got from No Starch folks.</p>
-Chapter 3 - Google Correlate example update2020-07-11T00:00:00+10:002020-07-11T00:00:00+10:00Amit Sahatag:doingmathwithpython.github.io,2020-07-11:/chapter-3-google-correlate-example-update.html<p>In Chapter 3 on Page 87, the book refers to the Google Correlate service. However, as of December 2019, the service has been shutdown.
-Since the chapter requires you to download a CSV formatted data, it is no longer possible. However, you can instead download a version of
-the data …</p><p>In Chapter 3 on Page 87, the book refers to the Google Correlate service. However, as of December 2019, the service has been shutdown.
-Since the chapter requires you to download a CSV formatted data, it is no longer possible. However, you can instead download a version of
-the data that I had used 5 years back when writing the book from
-<a class="reference external" href="https://github.com/doingmathwithpython/code/blob/master/chapter3/solutions/correlate-summer.csv">here</a>.</p>
-<p>Thanks to a reader for pointing me to this issue.</p>
-Coding Starter Kit Humble Bundle2020-03-17T00:00:00+10:002020-03-17T00:00:00+10:00Amit Sahatag:doingmathwithpython.github.io,2020-03-17:/humble-bundle-coding-starter.html<p>I am very excited to share that "Doing Math with Python" is part of No Starch Press's <a class="reference external" href="https://www.humblebundle.com/books/coding-starter-kit-no-starch-press-books?mc_cid=01272437d1&mc_eid=a8fa0cb420">Coding Starter Humble Bundle</a>.
-Of course, you get No Starch Press's other excellent coding books as part of the bundle.</p>
-<p>It's on for the next 20 days!</p>
-<div class="figure align-left">
-<img alt="Humble Bundle" src="http://doingmathwithpython.github.io/images/coding-starter-humble-bundle.png" />
-</div>
-<p>Your purchases will help support the …</p><p>I am very excited to share that "Doing Math with Python" is part of No Starch Press's <a class="reference external" href="https://www.humblebundle.com/books/coding-starter-kit-no-starch-press-books?mc_cid=01272437d1&mc_eid=a8fa0cb420">Coding Starter Humble Bundle</a>.
-Of course, you get No Starch Press's other excellent coding books as part of the bundle.</p>
-<p>It's on for the next 20 days!</p>
-<div class="figure align-left">
-<img alt="Humble Bundle" src="http://doingmathwithpython.github.io/images/coding-starter-humble-bundle.png" />
-</div>
-<p>Your purchases will help support the No Starch Foundation and Scratch Foundation.</p>
-<p>Get the bundle <a class="reference external" href="https://www.humblebundle.com/books/coding-starter-kit-no-starch-press-books?mc_cid=01272437d1&mc_eid=a8fa0cb420">here</a>.</p>
-Doing Math with Python in Python Humble Bundle2019-08-23T00:00:00+10:002019-08-23T00:00:00+10:00Amit Sahatag:doingmathwithpython.github.io,2019-08-23:/humble-bundle-python.html<p class="first last">Humble bundle Python</p>
-<p>"Doing Math with Python" is part of No Starch Press's <a class="reference external" href="https://www.humblebundle.com/books/python-programming-no-starch-books">Python Humble Bundle</a>.
-Of course, you get No Starch Press's other excellent Python books as part of the bundle. It's still on for the next 10 days!</p>
-<div class="figure align-left">
-<img alt="Humble Bundle" src="http://doingmathwithpython.github.io/images/python-humble-bundle.png" />
-</div>
-<p>Your purchases will help support the No Starch Foundation and Python Software Foundation.</p>
-<p>Get the bundle <a class="reference external" href="https://www.humblebundle.com/books/python-programming-no-starch-books">here</a>.</p>
-Doing Math with Python in Coder's Bookshelf Humble Bundle2019-03-29T00:00:00+10:002019-03-29T00:00:00+10:00Amit Sahatag:doingmathwithpython.github.io,2019-03-29:/humble-bundle-coders-bookshelf.html<p class="first last">Humble bundle</p>
-<p>"Doing Math with Python" is part of No Starch Press's "Pay what you want" <a class="reference external" href="https://www.humblebundle.com/books/coders-bookshelf-books">Coder's Bookshelf Bundle</a>.
-Your purchases will help support a charity of your choice.</p>
-<div class="figure align-center">
-<img alt="Humble Bundle" src="http://doingmathwithpython.github.io/images/humble-bundle-3.png" />
-</div>
-<p>Get the bundle <a class="reference external" href="https://www.humblebundle.com/books/coders-bookshelf-books">here</a>!</p>
-Doing Math with Python in Linux Geek Humble Bundle2018-07-24T13:20:00+10:002018-07-24T13:20:00+10:00Amit Sahatag:doingmathwithpython.github.io,2018-07-24:/humble-bundle-linux-geek.html<p class="first last">Humble bundle</p>
-<p>"Doing Math with Python" is part of No Starch Press's "Pay what you want" <a class="reference external" href="https://www.humblebundle.com/books/linux-geek-books">Linux Geek Humble Bundle</a>
-running for the next 7 days. Your purchases will help support EFF or a charity of your choice.</p>
-<div class="figure align-center">
-<img alt="Humble Bundle" src="http://doingmathwithpython.github.io/images/humble-bundle-2.png" />
-</div>
-<p>Get the bundle <a class="reference external" href="https://www.humblebundle.com/books/linux-geek-books">here</a>!</p>
-Anaconda 5.0 release2017-10-29T19:50:00+10:002017-10-29T19:50:00+10:00Amit Sahatag:doingmathwithpython.github.io,2017-10-29:/anaconda-5.0.html<p class="first last">Anaconda 5.0 release</p>
-<p><a class="reference external" href="https://www.anaconda.com/blog/developer-blog/announcing-the-release-of-anaconda-distribution-5-0/">Anaconda 5.0</a>
-was released a few days back. I tried all the <a class="reference external" href="http://doingmathwithpython.github.io/trying-out-solutions.html">sample solutions</a>
-and everything works as expected. The <a class="reference external" href="http://doingmathwithpython.github.io/pages/programs.html">chapter programs</a> should
-keep working as well.</p>
-<p>The versions of the relevant software in this release are:</p>
-<ul class="simple">
-<li>Python 3.6</li>
-<li>sympy 1.1.1</li>
-<li>matplotlib 2.1.0</li>
-</ul>
-<p>You can update your existing installation using:</p>
-<pre class="code literal-block">
-$ conda update conda
-$ conda install anaconda=5.0
-</pre>
-<p>(Thanks to Dan Wolfe for informing me of the incorrect command to install <cite>anaconda=5.0</cite>)</p>
-<p>A fresh installation of Anaconda 5.0 should still be similar to the <a class="reference external" href="https://doingmathwithpython.github.io/pages/software-installation.html">instructions</a>
-for earlier versions.</p>
-<div class="figure align-center">
-<img alt="Anaconda 5" src="http://doingmathwithpython.github.io/images/anaconda-5.png" />
-</div>
-<div class="figure align-center">
-<img alt="Anaconda 5" src="http://doingmathwithpython.github.io/images/anaconda-install-1.png" />
-</div>
-<div class="figure align-center">
-<img alt="Anaconda 5" src="http://doingmathwithpython.github.io/images/anaconda-install-2.png" />
-</div>
-<div class="figure align-center">
-<img alt="Anaconda 5" src="http://doingmathwithpython.github.io/images/anaconda-install-3.png" />
-</div>
-<p>I have so far verified both on Mac OS X and Linux. If you find any
-issues on Windows, please email me at
-<tt class="docutils literal">doingmathwithpython@gmail.com</tt> or post your query/tip to any of the
-following community forums:</p>
-<ul class="simple">
-<li><a class="reference external" href="https://www.facebook.com/doingmathwithpython">Facebook page</a></li>
-<li><a class="reference external" href="https://plus.google.com/u/0/communities/113121562865298236232">G+ Community</a></li>
-</ul>
-Doing Math with Python Humble Bundle2017-04-06T08:20:00+10:002017-04-06T08:20:00+10:00Amit Sahatag:doingmathwithpython.github.io,2017-04-06:/humble-bundle.html<p class="first last">Humble bundle</p>
-<p>No Starch Press has launched a "Pay what you want" <a class="reference external" href="https://www.humblebundle.com/books/python-book-bundle">Python Humble Bundle</a> running from April 5th - April 19th!
-Your purchases will help support the Python Software Foundation and I am excited to announce that Doing Math with Python is part of it.</p>
-<div class="figure align-center">
-<img alt="Humble Bundle" src="http://doingmathwithpython.github.io/images/humble-bundle.png" />
-</div>
-<p>For 1+ USD you can get three books including "Doing Math with Python"! For 15+ USD you get nine excellent Python books!</p>
-<p>Get the bundle <a class="reference external" href="https://www.humblebundle.com/books/python-book-bundle">here</a>!</p>
-Video: Doing Math with Python2016-08-16T12:00:00+10:002016-08-16T12:00:00+10:00Amit Sahatag:doingmathwithpython.github.io,2016-08-16:/video-pyconau-dmwp.html<p class="first last">PyConAU2016</p>
-<p>I spoke at the PyCon Australia Education Seminar on August 12, 2016. The video of the talk is now up.
-Thanks to Next Day Video!</p>
-<div class="youtube youtube-16x9"><iframe src="https://www.youtube.com/embed/XJOt4QQgx0A" allowfullscreen seamless frameBorder="0"></iframe></div><p>The PDF slides and the demos as Jupyter Notebooks (Python 3) are <a class="reference external" href="https://github.com/doingmathwithpython/pycon-au-2016">here</a>. I have some instructions to download them and try them out. If you face any issues, or have a question, please let me know.</p>
-<p>Thank you to all the PyCon Australia organizers and the Education seminar organizers for a great mini conference
-and the opportunity to be a part of it.</p>
-PyCon Australia 2016 Education Seminar2016-08-12T11:27:00+10:002016-08-12T11:27:00+10:00Amit Sahatag:doingmathwithpython.github.io,2016-08-12:/pycon-au-edu-summit-talk.html<p class="first last">PyCon AU education summit talk</p>
-<p>I attended the PyCon Australia 2016 Education seminar held on 12th August at Melbourne, Australia.
-I loved the energy of the seminar and was great to hear about all the ways educators in Australia are
-using Python for their teaching. Here are some notes I took, which I also link with the videos. You can
-find all the videos <a class="reference external" href="https://www.youtube.com/playlist?list=PLs4CJRBY5F1Jh6fFqT1p5TZRx5q06CcaR">here</a>.</p>
-<div class="section" id="python-at-monash">
-<h2>Python at Monash</h2>
-<ul class="simple">
-<li>Faculty of IT</li>
-<li>Python close to pseudocode</li>
-<li>Jupyter Notebooks</li>
-<li>Jupyter Hub installation at Monash</li>
-</ul>
-</div>
-<div class="section" id="keynote-smart-city-from-earth-to-mars-and-back">
-<h2>Keynote: Smart City - From earth to mars and back</h2>
-<ul class="simple">
-<li><a class="reference external" href="https://www.youtube.com/watch?v=BZExUKogvjQ&list=PLs4CJRBY5F1Jh6fFqT1p5TZRx5q06CcaR&index=8">Video</a></li>
-<li>Find a social mission</li>
-</ul>
-</div>
-<div class="section" id="teaching-python">
-<h2>Teaching Python</h2>
-<ul class="simple">
-<li><a class="reference external" href="https://www.youtube.com/watch?v=7oIwVjEVn0c&list=PLs4CJRBY5F1Jh6fFqT1p5TZRx5q06CcaR&index=9">Video</a></li>
-<li>Teaching isn't easy</li>
-<li>Programming isn't easy, it's new</li>
-<li>Grok learning, interactivepython.org, coursera, codecadaemy..</li>
-<li>Emphasise the fundamentals, don't assume anything, be explicit</li>
-</ul>
-</div>
-<div class="section" id="python-with-minecraft">
-<h2>Python with Minecraft</h2>
-<ul class="simple">
-<li><a class="reference external" href="https://www.youtube.com/watch?v=WwKkA9YV1K8&list=PLs4CJRBY5F1Jh6fFqT1p5TZRx5q06CcaR&index=7">Video</a></li>
-<li>Get kids excited</li>
-<li>Consumers to creators</li>
-</ul>
-</div>
-<div class="section" id="micropython">
-<h2>MicroPython</h2>
-<ul class="simple">
-<li><a class="reference external" href="https://www.youtube.com/watch?v=oCEZyJqkMrE&list=PLs4CJRBY5F1Jh6fFqT1p5TZRx5q06CcaR&index=6">Video</a></li>
-<li>Groklearning Microbit</li>
-<li><a class="reference external" href="https://groklearning.com/competition/codequest-microbit-2016/">https://groklearning.com/competition/codequest-microbit-2016/</a></li>
-</ul>
-</div>
-<div class="section" id="teaching-geometry-using-logo-python-turtle-module">
-<h2>Teaching Geometry using Logo/Python turtle module</h2>
-<ul class="simple">
-<li><a class="reference external" href="https://www.youtube.com/watch?v=gu3QDizt-_Y&list=PLs4CJRBY5F1Jh6fFqT1p5TZRx5q06CcaR&index=5">Video</a></li>
-<li>Don't teach subjects in silos</li>
-<li>Show students you can do real useful stuff with programming</li>
-<li>Turtle powered Geometry</li>
-<li>Grok learning lessons (turtle in your browser)</li>
-</ul>
-</div>
-PyCon Australia 2016 Education Seminar: Doing Math with Python2016-08-06T18:00:00+10:002016-08-06T18:00:00+10:00Amit Sahatag:doingmathwithpython.github.io,2016-08-06:/pyconau-dmwp.html<p class="first last">PyConAU2016</p>
-<p>Hello everyone, I will be <a class="reference external" href="https://2016.pycon-au.org/schedule/83/view_talk?day=friday">speaking</a> at the PyCon AU education seminar coming August 12, 2016 at Melbourne, Australia (3.00 - 3.40 PM).</p>
-<p>I have put up my in progress slides (PDF) and the demos as Jupyter Notebooks (Python 3), I plan to use during the talk on <a class="reference external" href="https://github.com/doingmathwithpython/pycon-au-2016">GitHub</a>. If you are coming along, please let me know if there is anything specific I can share and discuss.</p>
-<p><strong>Links</strong></p>
-<ul class="simple">
-<li><a class="reference external" href="https://2016.pycon-au.org/schedule/83/view_talk?day=friday">Talk abstract</a></li>
-<li><a class="reference external" href="https://github.com/doingmathwithpython/pycon-au-2016">Slides and Demos</a></li>
-</ul>
-O'Reilly Webcast: Doing Math with Python2016-07-01T14:00:00+10:002016-07-01T14:00:00+10:00Amit Sahatag:doingmathwithpython.github.io,2016-07-01:/oreilly-webcast-doing-math.html<p class="first last">O'Reilly Webcast</p>
-<p><strong>Updated post after the webcast</strong></p>
-<p>A big thank you to all of you who turned up for the webcast across the world. I really had a great time and hope the session was informative to all of you. For those who didn't make it to the webcast, it's now available for <a class="reference external" href="http://www.oreilly.com/pub/e/3712">viewing</a>.</p>
-<p>The slides, transcript and the demos are all available at the <a class="reference external" href="https://github.com/doingmathwithpython/oreilly-webcast-2016">GitHub repository</a>. Feel free to use them in any capacity you find useful. If you already have <a class="reference external" href="https://doingmathwithpython.github.io/pages/software-installation.html">Anaconda installed</a>, get the above code, and run <cite>jupyter-notebook</cite> from the same directory to be able to play with the code.</p>
-<p><em>Links of Interest</em></p>
-<ul class="simple">
-<li><a class="reference external" href="http://www.oreilly.com/pub/e/3712">Webcast Recording</a></li>
-<li><a class="reference external" href="https://github.com/doingmathwithpython/oreilly-webcast-2016">Slides, Transcript and Demos</a></li>
-<li><a class="reference external" href="https://www.nostarch.com/doingmathwithpython">Doing Math with Python book</a></li>
-</ul>
-<p>Some of you asked a number of questions which I couldn't answer as well as I would have wanted to during the webcast, so I will make a better attempt below:</p>
-<p><strong>Q: What is the difference between an interpreter, ide and text editor? And what do you recommend for beginners?</strong></p>
-<p>An <tt class="docutils literal">interpreter</tt> is what runs your program. Without going into the details, the Python interpreter is what converts a statement such as <tt class="docutils literal"><span class="pre">print("Hello")</span></tt> to a form that can be understood by the computer to finally print <tt class="docutils literal">Hello</tt> on screen.
-An <tt class="docutils literal">IDE</tt> or Integrated Development Environment is a software application where we can write programs and run them usually via Graphical User Interface. IDEs generally feature helpful features such as code completion and can be useful when working with large projects. A <tt class="docutils literal">text editor</tt> is for writing our programs or other text. It usually doesn't support features that an IDE would support but of course, you can configure and enhance text editors to give you IDE-like features.</p>
-<p>For beginners, I recommend starting with text editors. I think that doesn't overwhelm someone who is learning with the IDE features. That said, <a class="reference external" href="https://docs.python.org/3/library/idle.html">IDLE</a> is a good in-between choice for beginners and one that I personally use in the book and definitely would be my first choice.</p>
-<p><strong>Q: What library do we use for importing metric units that works well with sympy?</strong></p>
-<p>I would recommend taking a look at SymPy's <a class="reference external" href="http://docs.sympy.org/dev/modules/physics/units.html#">Units</a> module and see if it has what you need. In addition, and if you already don't know about it, <a class="reference external" href="https://github.com/hgrecco/pint">pint</a> would be another library to look at.</p>
-<p><strong>Q: Do you use notebook for exploratory work?</strong></p>
-<p>Yes, I use notebook for exploratory work. I think notebooks are great when you want the code and result together in a single document. It's great for sharing too. I recently created <a class="reference external" href="http://echorand.me/presentation-slides-with-jupyter-notebook.html#.V3XhNe0yphE">slides</a> as a Notebook.</p>
-<p><strong>Q: Can Sympy be used for the development in a engineering software (i.e. Finite Element Method)? Would the computational speed be (good)? (Not sure about the second part of the question)</strong></p>
-<p>You may be interested in taking a look at <a class="reference external" href="http://sfepy.org/doc-devel/index.html">SfePy</a></p>
-<p><strong>Q: Thoughts on Cython? Sagemath?</strong></p>
-<p>I haven't worked much with Cython. I know about it and what it can useful for. So, I guess if you are looking for speed, definitely look into it. I would also recommend looking at <a class="reference external" href="http://numba.pydata.org/">Numba</a>. Sagemath is more of a system itself than a library. It integrates popular Python libraries and would definitely be something to explore.</p>
-<p><strong>Q: Should students use IDLE or a notebook format?</strong></p>
-<p>I would recommend using IDLE to start with. It gives the opportunity for the student to at least get an idea of the cycle of editing code and running it. I would only introduce notebook later and in addition to IDLE. Both have their merits, but Notebook just introduces one more thing to grasp in the beginning.</p>
-<p><strong>Q: Any recommendations for introducing 3D graphics e.g. polyhedrons on screen?</strong></p>
-<p>I haven't explored them, you may want to look at <a class="reference external" href="https://pi3d.github.io/html/">Pi3D</a> or <a class="reference external" href="http://vpython.org/">VPython</a>.</p>
-<p><strong>Q: How well do SymPy and Numpy work together?</strong></p>
-<p>No personal experience, but searching a bit, it looks like you may want to look at SymPy's <a class="reference external" href="http://docs.sympy.org/dev/modules/utilities/lambdify.html">Lambdify</a> feature. The <a class="reference external" href="https://groups.google.com/forum/#!forum/sympy">SymPy google group</a> may give you a better answer.</p>
-<p><strong>Q: You are working in Jupyter - can the "app"s you should be embedded in a regular HTML web page?</strong></p>
-<p>I haven't personally tried this. I think this <a class="reference external" href="https://jakevdp.github.io/blog/2013/12/05/static-interactive-widgets/">post</a> may give you clues to do it. O'Reilly Media's project <a class="reference external" href="https://github.com/oreillymedia/thebe">thebe</a> may be another option to look at.</p>
-<p><strong>Announcement post</strong></p>
-<p>I am very excited to share that I am doing a webcast this coming week with O'Reilly titled
-"Doing Math with Python". You can register for it on the <a class="reference external" href="http://www.oreilly.com/pub/e/3712">event page</a>.</p>
-<p>Here are the date and time of the webcast:</p>
-<ul class="simple">
-<li>Wed, June 29th at 7 PM, San Francisco</li>
-<li>Wed, June 29th at 10pm, New York</li>
-<li>Thu, Jun 30th at 3am - London</li>
-<li>Thu, Jun 30th at 7:30am - Mumbai</li>
-<li>Thu, Jun 30th at 10am - Beijing</li>
-<li>Thu, Jun 30th at 11am - Tokyo</li>
-<li>Thu, Jun 30th at 12pm - Sydney</li>
-</ul>
-<p>I have created a <a class="reference external" href="https://github.com/doingmathwithpython/oreilly-webcast-2016">GitHub repository</a> which
-will have the rough transcript, final slides and the code examples as Jupyter Notebooks.</p>
-Python 2016 Education Summit Notes2016-05-29T17:00:00+10:002016-05-29T17:00:00+10:00Amit Sahatag:doingmathwithpython.github.io,2016-05-29:/education-summit-pycon-2016.html<p class="first last">Education Summit Summary</p>
-<p>I participated in the education summit today. My talk slides for "Doing Math with Python" is available <a class="reference external" href="https://doingmathwithpython.github.io/pycon-us-2016/#/">here</a>.</p>
-<p>Here are some notes on the other talks I attended.</p>
-<div class="section" id="keynote">
-<h2>Keynote</h2>
-<ul class="simple">
-<li>Education WG</li>
-<li>PythonZero</li>
-<li>GPIO Zero</li>
-<li>Network zero: <a class="reference external" href="https://github.com/tjguk/networkzero/">https://github.com/tjguk/networkzero/</a></li>
-<li>Zero: based on an established package, emphasis is on up-and-running use in a classroom, Relevant error messages</li>
-</ul>
-<p>Micro:bit</p>
-<ul class="simple">
-<li>Mu, demos</li>
-</ul>
-</div>
-<div class="section" id="lessons-learned-from-teaching-python">
-<h2>Lessons learned from teaching Python</h2>
-<ul class="simple">
-<li>Put your work out there on the internet</li>
-<li>Think about internationalization</li>
-<li>Self publish Amazon's create space, Kindle</li>
-<li>Quizzes, collect data, data mining</li>
-<li>Instructor section</li>
-<li>Online markup of code</li>
-<li>EpicPen</li>
-<li>YouTube channel</li>
-<li>Libraries: Pygame, Arcade</li>
-</ul>
-</div>
-<div class="section" id="pyzero">
-<h2>Pyzero</h2>
-<ul class="simple">
-<li>Demos</li>
-<li>pzrun</li>
-</ul>
-</div>
-<div class="section" id="minecraft-with-python">
-<h2>Minecraft with Python</h2>
-<ul class="simple">
-<li>Use Python to interact with Minecraft</li>
-<li>CoderDojo Minecraft bundle</li>
-<li>Using Jupyter Notebooks</li>
-</ul>
-</div>
-<div class="section" id="pycharm-edu">
-<h2>PyCharm Edu</h2>
-<ul class="simple">
-<li>Courses</li>
-<li>Checkout PyCharm EDU for creating courses</li>
-</ul>
-</div>
-<div class="section" id="teaching-data-structures-with-python">
-<h2>Teaching data structures with Python</h2>
-<ul class="simple">
-<li>Python makes the teacher happy</li>
-<li>Lab only</li>
-<li>Algorithms in Python + C (Side by side)</li>
-<li>Two languages worked well for them.</li>
-<li>Low level language: easy to find the complexity of the algorithm</li>
-<li>High level language: hard to find the complexity of the algorithm</li>
-</ul>
-</div>
-<div class="section" id="merlin-for-data-science-education">
-<h2>Merlin for Data Science Education</h2>
-<ul class="simple">
-<li>Where to even start?</li>
-<li>Effort justification</li>
-<li>Spending 2hr out of a 8hr session in fixing something is not worth it</li>
-<li>Shouldn't be proud of battling with tool set rather than not doing the real work</li>
-<li>Merlin - <a class="reference external" href="http://www.darklabsdatascience.com/project_merlin/">http://www.darklabsdatascience.com/project_merlin/</a></li>
-</ul>
-</div>
-PyCon Education Summit Talk2016-05-26T11:27:00+10:002016-05-26T11:27:00+10:00Amit Sahatag:doingmathwithpython.github.io,2016-05-26:/pycon-edu-summit-talk.html<p class="first last">PyCon education summit talk</p>
-<p>Hi everyone, I have uploaded the <a class="reference external" href="https://doingmathwithpython.github.io/pycon-us-2016/">slides</a> for my upcoming talk at the PyCon Education Summit. If you are coming to the talk, feel free to have a look at the slides and have any questions/comments ready for me.</p>
-<p>The slides are made using Jupyter Notebook + nbconvert magic. Thank you to everyone who makes these things happen. You can see the slides notebook <a class="reference external" href="https://github.com/doingmathwithpython/pycon-us-2016">here</a>.</p>
-<p>As a PyCon special, No Starch Press has setup a discount code <tt class="docutils literal">PYCONMATH</tt> code which will give you 30 % off my book, <a class="reference external" href="https://www.nostarch.com/doingmathwithpython">Doing Math with Python</a> and is valid from May 26th - June 8th.</p>
-SymPy 1.0 and Anaconda 4.0 releases2016-04-11T19:50:00+10:002016-04-11T19:50:00+10:00Amit Sahatag:doingmathwithpython.github.io,2016-04-11:/sympy-1.0-anaconda-4.0.html<p class="first last">sympy 1.0 and Anaconda 4.0</p>
-<p><a class="reference external" href="http://sympy.org">SymPy 1.0</a> was released recently and <a class="reference external" href="https://www.continuum.io/blog/developer-blog/anaconda-4-release">Anaconda 4.0</a>
-was just released. I tried all the <a class="reference external" href="http://doingmathwithpython.github.io/trying-out-solutions.html">sample solutions</a>
-and everything works as expected. The <a class="reference external" href="http://doingmathwithpython.github.io/pages/programs.html">chapter programs</a> should
-keep working as well.</p>
-<p>You can get both the updates when you install Anaconda 4.0 or updated
-your existing Anaconda installation:</p>
-<pre class="code literal-block">
-$ conda update conda
-$ conda update anaconda
-</pre>
-<p>I have so far verified both on Mac OS X and Linux. If you find any
-issues on Windows, please email me at
-<tt class="docutils literal">doingmathwithpython@gmail.com</tt> or post your query/tip to any of the
-following community forums:</p>
-<ul class="simple">
-<li><a class="reference external" href="https://www.facebook.com/doingmathwithpython">Facebook page</a></li>
-<li><a class="reference external" href="https://plus.google.com/u/0/communities/113121562865298236232">G+ Community</a></li>
-</ul>
-What readers are saying2016-02-14T10:00:00+10:002016-02-14T10:00:00+10:00Amit Sahatag:doingmathwithpython.github.io,2016-02-14:/what-readers-are-saying.html<p class="first last">Reviews of Doing Math with Python</p>
-<p>Readers have shared how they are finding <em>Doing Math with Python</em> by
-posting reviews on Amazon and their own blog. You can view all of them
-on the <a class="reference external" href="http://doingmathwithpython.github.io/pages/reviews.html">Reviews</a> page.</p>
-<p>Some readers have also been kind enough to let me know personally how the book
-has helped them to restart their programming, or looking at something
-they have been putting off. As the author, I think this is the highest
-level of appreciation that I could have hoped for.</p>
-<p>Recently, Aaron Meurer (the lead developer of SymPy) mentioned the
-book in an <a class="reference external" href="http://pythonpodcast.com/aaron-meurer-sympy.html">episode</a> of
-Podcast.__init__ titled "SymPy with Aaron Meurer". If you are curious
-to learn more about SymPy, I would recommend listening to it.</p>
-<p>I am curious to hear more. If you want to get in touch personally,
-please do so via any of the following channels:</p>
-<ul class="simple">
-<li><a class="reference external" href="https://www.facebook.com/doingmathwithpython">Facebook page</a></li>
-<li><a class="reference external" href="https://plus.google.com/u/0/communities/113121562865298236232">G+ Community</a></li>
-<li><a class="reference external" href="https://twitter.com/mathwithpython">Twitter</a></li>
-</ul>
-<p>You can email me at <a class="reference external" href="mailto:doingmathwithpython@gmail.com">doingmathwithpython@gmail.com</a>.</p>
-<p>Alternatively, if you just plan to write a review, please do so on
-Amazon, O'Reilly or your personal blog.</p>
-Trying out the solutions in IDLE2015-11-18T08:20:00+10:002015-11-18T08:20:00+10:00Amit Sahatag:doingmathwithpython.github.io,2015-11-18:/trying-out-solutions.html<p class="first last">Trying out the solutions</p>
-<p>Once you <a class="reference external" href="https://www.nostarch.com/download/doingmath_code.zip">download</a> the solutions ZIP file, and extract it you will
-find the solutions for each chapter in the corresponding sub-directory.</p>
-<div class="figure align-center">
-<img alt="Extracted ZIP archive" src="http://doingmathwithpython.github.io/images/zip-extracted.png" />
-</div>
-<p>The <strong>PDF</strong> file contains explanations for each of the solutions
-similar to the explanations for the programs in the book.</p>
-<p>Before you can try the programs out, you will have to open them first in IDLE.
-Let's consider the solution to a challenge posed in Chapter 6 to draw
-the Mandelbrot set - <tt class="docutils literal">mandelbrot.py</tt>. Start <tt class="docutils literal">IDLE</tt> and click on the menu item <tt class="docutils literal">File >
-Open</tt> and navigate to the location where you extracted the directory
-above and open the file <tt class="docutils literal">mandelbrot.py</tt>.</p>
-<div class="figure align-center">
-<img alt="IDLE window" src="http://doingmathwithpython.github.io/images/idle-1.png" />
-<p class="caption">Snapshot of the source code</p>
-</div>
-<div class="section" id="running-the-program">
-<h2>Running the program</h2>
-<p>To run the program, click on <tt class="docutils literal">Run > Run Module</tt> and you should see
-the Mandelbrot set in the matplotlib window.</p>
-<div class="figure align-center">
-<img alt="Mandelbrot Set" src="http://doingmathwithpython.github.io/images/idle-2.png" />
-<p class="caption">Mandelbrot set</p>
-</div>
-<p>All the solutions should be ready to run, try them out, make changes
-to experiment and let me know what you come up with!</p>
-<p>Email me at <tt class="docutils literal">doingmathwithpython@gmail.com</tt> or post your query/tip to any of the
-following community forums:</p>
-<ul class="simple">
-<li><a class="reference external" href="https://www.facebook.com/doingmathwithpython">Facebook page</a></li>
-<li><a class="reference external" href="https://plus.google.com/u/0/communities/113121562865298236232">G+ Community</a></li>
-</ul>
-</div>
-Chapter code and Errata2015-09-11T08:20:00+10:002015-09-11T08:20:00+10:00Amit Sahatag:doingmathwithpython.github.io,2015-09-11:/chapter-code-errata.html<p class="first last">Chapter code and errata</p>
-<p>You can find the chapter programs and snippets linked from the <a class="reference external" href="http://doingmathwithpython.github.io/pages/programs.html">programs</a> page. They should be free
-from any error mentioned on the <a class="reference external" href="http://doingmathwithpython.github.io/pages/errata.html">errata</a> page.</p>
-<div class="section" id="stay-in-touch">
-<h2>Stay in touch</h2>
-<p>You can stay connected with the book, its readers and me via the
-following channels:</p>
-<ul class="simple">
-<li><a class="reference external" href="https://www.facebook.com/doingmathwithpython">Facebook page</a></li>
-<li><a class="reference external" href="https://plus.google.com/u/0/communities/113121562865298236232">G+ Community</a></li>
-<li><a class="reference external" href="https://twitter.com/mathwithpython">Twitter</a></li>
-</ul>
-<p>You can contact me directly via:</p>
-<ul class="simple">
-<li>Twitter: <a class="reference external" href="https://twitter.com/mathwithpython">@mathwithpython</a></li>
-<li>Email : <a class="reference external" href="mailto:doingmathwithpython@gmail.com">doingmathwithpython@gmail.com</a></li>
-</ul>
-</div>
-Doing Math with Python Available now!2015-09-02T08:00:00+10:002015-09-02T08:00:00+10:00Amit Sahatag:doingmathwithpython.github.io,2015-09-02:/available-now.html<p class="first last">Available now!</p>
-<p>Hi all, I am very excited to announce that the book is now available for
-purchase in print and electronic formats from various online stores
-including <a class="reference external" href="http://www.amazon.com/Doing-Math-Python-Programming-Statistics/dp/1593276400">Amazon</a>
-and <a class="reference external" href="https://www.nostarch.com/doingmathwithpython">No Starch Press</a>.
-Please see the <a class="reference external" href="http://doingmathwithpython.github.io/pages/buy.html">Buy</a> page for others.</p>
-<a class="reference external image-reference" href="http://www.nostarch.com/doingmathwithpython"><img alt="Book cover" class="align-center" src="http://doingmathwithpython.github.io/images/cover.png" /></a>
-<p>If you are keen to take a look at the contents and read a sample
-chapter, please head over to <a class="reference external" href="https://www.nostarch.com/doingmathwithpython">No Starch's book page</a>.</p>
-<p>Alternatively, if you are keen to recieve a review copy, please email
-<cite>doingmathwithpython@gmail.com</cite> and I will try to request one from the
-publishers.</p>
-<div class="section" id="stay-in-touch">
-<h2>Stay in touch</h2>
-<p>You can stay connected with the book, its readers and me via the
-following channels:</p>
-<ul class="simple">
-<li><a class="reference external" href="https://www.facebook.com/doingmathwithpython">Facebook page</a></li>
-<li><a class="reference external" href="https://plus.google.com/u/0/communities/113121562865298236232">G+ Community</a></li>
-<li><a class="reference external" href="https://twitter.com/mathwithpython">Twitter</a></li>
-</ul>
-<p>You can contact me directly via:</p>
-<ul class="simple">
-<li>Twitter: <a class="reference external" href="https://twitter.com/mathwithpython">@mathwithpython</a></li>
-<li>Email : <a class="reference external" href="mailto:doingmathwithpython@gmail.com">doingmathwithpython@gmail.com</a></li>
-</ul>
-</div>
-All chapters completed, off to the printers2015-08-15T23:27:00+10:002015-08-15T23:27:00+10:00Amit Sahatag:doingmathwithpython.github.io,2015-08-15:/off-to-printers.html<p class="first last">off to printers!</p>
-<p>I am very excited to write that all the chapters has been completed
-and the book is currently with the printers! You can find out more
-about the contents (including a detailed table of contents) from the
-<a class="reference external" href="http://doingmathwithpython.github.io/pages/about.html">About</a> page.</p>
-<p>You can stay connected with the book, its readers and me via the
-following channels:</p>
-<ul class="simple">
-<li><a class="reference external" href="https://www.facebook.com/doingmathwithpython">Facebook page</a></li>
-<li><a class="reference external" href="https://plus.google.com/u/0/communities/113121562865298236232">G+ Community</a></li>
-<li><a class="reference external" href="https://twitter.com/mathwithpython">Twitter</a></li>
-</ul>
-Introduction to "Doing Math with Python"2015-05-24T23:27:00+10:002015-05-24T23:27:00+10:00Amit Sahatag:doingmathwithpython.github.io,2015-05-24:/hello-world.html<p class="first last">Hello World</p>
-<p>Hi all, this is the blog for my book "Doing Math with Python".</p>
-<a class="reference external image-reference" href="http://www.nostarch.com/doingmathwithpython"><img alt="Book cover" class="align-center" src="http://doingmathwithpython.github.io/images/cover.png" /></a>
-<p>The first six chapters of the book are already available via the
-publisher's early access program. You can learn briefly about each
-chapter on the <a class="reference external" href="http://doingmathwithpython.github.io/pages/about.html">About</a> page.
-Going forward, I will be sharing updates regarding the book and posting
-original content related to that discussed in the book.</p>
-<p>You can stay connected with the book, its readers and me via the
-following channels:</p>
-<ul class="simple">
-<li><a class="reference external" href="https://www.facebook.com/doingmathwithpython">Facebook page</a></li>
-<li><a class="reference external" href="https://plus.google.com/u/0/communities/113121562865298236232">G+ Community</a></li>
-<li><a class="reference external" href="https://twitter.com/mathwithpython">Twitter</a></li>
-</ul>
-
\ No newline at end of file
diff --git a/hello-world.html b/hello-world.html
deleted file mode 100644
index db70491..0000000
--- a/hello-world.html
+++ /dev/null
@@ -1,92 +0,0 @@
-
-
-
-
-
-
- Introduction to "Doing Math with Python"
-
-
-
-
-
-
-
-
Hi all, this is the blog for my book "Doing Math with Python".
-
-
The first six chapters of the book are already available via the
-publisher's early access program. You can learn briefly about each
-chapter on the About page.
-Going forward, I will be sharing updates regarding the book and posting
-original content related to that discussed in the book.
-
You can stay connected with the book, its readers and me via the
-following channels:
"Doing Math with Python" is part of No Starch Press's "Pay what you want" Coder's Bookshelf Bundle.
-Your purchases will help support a charity of your choice.
I am very excited to share that "Doing Math with Python" is part of No Starch Press's Coding Starter Humble Bundle.
-Of course, you get No Starch Press's other excellent coding books as part of the bundle.
-
It's on for the next 20 days!
-
-
-
-
Your purchases will help support the No Starch Foundation and Scratch Foundation.
I am still surprised that the book still continues to be relevant, and i am quietly happy that I could produce such a book,
-thanks to all the help i got from No Starch folks.
"Doing Math with Python" is part of No Starch Press's "Pay what you want" Linux Geek Humble Bundle
-running for the next 7 days. Your purchases will help support EFF or a charity of your choice.
"Doing Math with Python" is part of No Starch Press's Python Humble Bundle.
-Of course, you get No Starch Press's other excellent Python books as part of the bundle. It's still on for the next 10 days!
-
-
-
-
Your purchases will help support the No Starch Foundation and Python Software Foundation.
No Starch Press has launched a "Pay what you want" Python Humble Bundle running from April 5th - April 19th!
-Your purchases will help support the Python Software Foundation and I am excited to announce that Doing Math with Python is part of it.
-
-
-
-
For 1+ USD you can get three books including "Doing Math with Python"! For 15+ USD you get nine excellent Python books!
In Chapter 3 on Page 87, the book refers to the Google Correlate service. However, as of December 2019, the service has been shutdown.
-Since the chapter requires you to download a CSV formatted data, it is no longer possible. However, you can instead download a version of
-the data …
I am very excited to share that "Doing Math with Python" is part of No Starch Press's Coding Starter Humble Bundle.
-Of course, you get No Starch Press's other excellent coding books as part of the bundle.
If you are using Ubuntu 16.04 and don't want to install the Anaconda
-Python distribution for trying out the book's
-programs or
-the sample solutions, this
-post is for you.
-
Ubuntu 16.04 already comes with Python 3 installed, so we only need to install
-the following packages - matplotlib, matplotlib-venn, sympy and idle3.
I am very excited to write that all the chapters has been completed
-and the book is currently with the printers! You can find out more
-about the contents (including a detailed table of contents) from the
-About page.
-
You can stay connected with the book, its readers and me via the
-following channels:
A big thank you to all of you who turned up for the webcast across the world. I really had a great time and hope the session was informative to all of you. For those who didn't make it to the webcast, it's now available for viewing.
-
The slides, transcript and the demos are all available at the GitHub repository. Feel free to use them in any capacity you find useful. If you already have Anaconda installed, get the above code, and run jupyter-notebook from the same directory to be able to play with the code.
Some of you asked a number of questions which I couldn't answer as well as I would have wanted to during the webcast, so I will make a better attempt below:
-
Q: What is the difference between an interpreter, ide and text editor? And what do you recommend for beginners?
-
An interpreter is what runs your program. Without going into the details, the Python interpreter is what converts a statement such as print("Hello") to a form that can be understood by the computer to finally print Hello on screen.
-An IDE or Integrated Development Environment is a software application where we can write programs and run them usually via Graphical User Interface. IDEs generally feature helpful features such as code completion and can be useful when working with large projects. A text editor is for writing our programs or other text. It usually doesn't support features that an IDE would support but of course, you can configure and enhance text editors to give you IDE-like features.
-
For beginners, I recommend starting with text editors. I think that doesn't overwhelm someone who is learning with the IDE features. That said, IDLE is a good in-between choice for beginners and one that I personally use in the book and definitely would be my first choice.
-
Q: What library do we use for importing metric units that works well with sympy?
-
I would recommend taking a look at SymPy's Units module and see if it has what you need. In addition, and if you already don't know about it, pint would be another library to look at.
-
Q: Do you use notebook for exploratory work?
-
Yes, I use notebook for exploratory work. I think notebooks are great when you want the code and result together in a single document. It's great for sharing too. I recently created slides as a Notebook.
-
Q: Can Sympy be used for the development in a engineering software (i.e. Finite Element Method)? Would the computational speed be (good)? (Not sure about the second part of the question)
I haven't worked much with Cython. I know about it and what it can useful for. So, I guess if you are looking for speed, definitely look into it. I would also recommend looking at Numba. Sagemath is more of a system itself than a library. It integrates popular Python libraries and would definitely be something to explore.
-
Q: Should students use IDLE or a notebook format?
-
I would recommend using IDLE to start with. It gives the opportunity for the student to at least get an idea of the cycle of editing code and running it. I would only introduce notebook later and in addition to IDLE. Both have their merits, but Notebook just introduces one more thing to grasp in the beginning.
-
Q: Any recommendations for introducing 3D graphics e.g. polyhedrons on screen?
-
I haven't explored them, you may want to look at Pi3D or VPython.
-
Q: How well do SymPy and Numpy work together?
-
No personal experience, but searching a bit, it looks like you may want to look at SymPy's Lambdify feature. The SymPy google group may give you a better answer.
-
Q: You are working in Jupyter - can the "app"s you should be embedded in a regular HTML web page?
-
I haven't personally tried this. I think this post may give you clues to do it. O'Reilly Media's project thebe may be another option to look at.
-
Announcement post
-
I am very excited to share that I am doing a webcast this coming week with O'Reilly titled
-"Doing Math with Python". You can register for it on the event page.
-
Here are the date and time of the webcast:
-
-
Wed, June 29th at 7 PM, San Francisco
-
Wed, June 29th at 10pm, New York
-
Thu, Jun 30th at 3am - London
-
Thu, Jun 30th at 7:30am - Mumbai
-
Thu, Jun 30th at 10am - Beijing
-
Thu, Jun 30th at 11am - Tokyo
-
Thu, Jun 30th at 12pm - Sydney
-
-
I have created a GitHub repository which
-will have the rough transcript, final slides and the code examples as Jupyter Notebooks.
Doing Math with Python is written by Amit Saha and published by No
-Starch Press.
-It has been translated to French, Simplified Chinese, Korean and Japanese.
-
The English version of the book is now available in print and electronic formats (including
-Amazon Kindle). Please refer to the Buy
-page. Some readers have taken the time out to post a review of the
-book on Amazon and elsewhere. Please refer to the Reviews page.
-
-
There are seven chapters and 2 Appendices in the book. A detailed
-table of contents is available from the publisher's website.
-
-
Chapter 1: Numbers
-
This chapter starts with the absolute basics of handling numbers in
-Python. It discusses integers, floating point numbers, fractions,
-complex numbers and performing operations with them.
-
-
-
Chapter 2: Visualizing Data with Graphs
-
This chapter introduces Matplotlib and shows how to create graphs
-representing collections of numbers.
-
-
-
Chapter 3: Describing Data with Statistics
-
As the title suggests, this chapter is all about the statistical
-measures one would first learn in high school – mean, median, mode,
-frequency table, range, variance, standard deviation and linear
-correlation are discussed.
-
-
-
Chapter 4: Algebra and Symbolic Math with SymPy
-
The first three chapters are all about number crunching. The fourth
-chapter introduces the reader to the basics of manipulating symbolic
-expressions using SymPy. Factorizing algebraic expressions, solving
-equations, plotting from symbolic expressions are some of the topics
-discussed in this chapter.
-
-
-
Chapter 5: Sets and Probability
-
This chapter starts off with how to create a set and demonstrating the
-common set operations. Utility of the different set operations are
-demonstrated via simple applications. For example, Cartesian product
-is used to write a program to simulate an experiment to calculate the
-time period of a simple pendulum of different lengths and at places
-with varying gravity. Union and intersection operations are applied to
-finding the probability of events.
-
The chapter then moves onto discussing how to generate uniform and non
-uniform random numbers, and using them to simulate scenarios such as a
-die roll and a fictional ATM which dispenses dollar bills of different
-denominations with varying probability.
-
-
-
Chapter 6: Drawing shapes and Fractals
-
This chapter is logically divided into two parts. The first part
-introduces the reader to matplotlib patches which allows drawing
-geometric shapes (circles and polygons), followed by matplotlib’s
-animation API which allows drawing animated figures. The trajectory of
-a projectile motion discussed elsewhere in various contexts is
-animated combining both these things.
-
The second part of the chapter introduces the concept of geometric
-transformation. Combining that with the knowledge of generating random
-numbers learned earlier in Chapter 5, the reader will learn how to
-draw fractals such as the Barnsley Fern, Sierpinski triangle and
-Mandelbrot set.
-
-
-
Chapter 7: Solving Calculus Problems
-
This chapter discusses solving differentiation and integration tasks
-using programs. As applications, the gradient ascent (and descent)
-methods and continuous probability are discussed.
-
-
-
Appendix A
-
This appendix covers the installation of software required to run the
-programs in the book on Microsoft Windows, Linux and Mac OS X.
-
-
-
Appendix B
-
This appendix discusses some Python topics which the reader may not be
-familiar with, but are needed to follow some parts of the book. It
-also includes topics which provide additional information beyond that
-required for the programs in the book.
-
-
Stay in touch
-
You can stay connected with the book, its readers and me via the
-following channels:
On Page 47, in the second last sentence of the second last paragraph, the book currently states "The x-axis of the
-graph displays the force, and the y-axis displays the distance.". It should be "The x-axis of the graph displays the distance
-and the y-axis displays force".
-
(Thanks to Mike Beasley for pointing this out)
-
On Page 48, Figure 2-12 caption should be "Figure 2-12: Visualization of the relationship between the gravitational force and
-the distance" and not "..squared distance".
-
On Page 52, in the paragraph starting with "In this program...", the book currently states,
-".. we calculate the time of flight and then call the frange() function with the values for start, final, and
-increment set to 0,". "increment" should be "interval".
-
(Thanks to a lovely Japanese reader for pointing this out).
-
-
-
Chapter 3
-
On Page 77, in the program for finding the correlation coefficient, the last for loop has an extra space infront of
-it. It should be:
-
-..
-y_square = []
-for yi in y:
- y_square.append(yi**2)
-...
-
-
(Thanks to Elmar Bucher for pointing this out)
-
On Page 87, the book refers to the Google Correlate service. However, as of December 2019,
-the service has been shutdown. Since the chapter requires you to download a CSV formatted data,
-it is no longer possible. However, you can instead download a version of the data that I had
-used 5 years back when writing the book from here.
-
(Thanks to Tuomo Kalliokoski)
-
-
-
Chapter 4
-
On page 97, in the section "Factorizing and Expanding Expressions", the
-expand function should be imported before we can use it via
-from sympy import expand.
-
On page 99, in the code snippet on Line (2) and the following, the indentation is wrong.
-It should be:
-
-for i in range(2, n+1):
- series = series + (x**i)/i
-
-
(Thanks to Taylan Yemliha)
-
On page 112, an import is missing - SympifyError used later in the
-try..except block. The initial import statement should hence be:
On page 115, in the first paragram, "using the first letter of the color.." is not correct for black, since we use k
-for black color.
-
(Thanks to Elmar Bucher for pointing this out)
-
-
-
Chapter 5
-
On page 132, in the section "Probability", the program should start
-with the import statment from sympy import FiniteSet. (Thanks to
-Dexter Edge)
-
On page 132, in the section "Probability," the code line above the one
-marked with a (3), which reads for num in s: should instead read:
-for num in space.
-
On page 135, in "Can You Roll That Score?" there is no need for import matplotlib.pyplot as plt.
-
(Thanks to Elmar Bucher for the above)
-
On page 139, in the code for simulating a fictional ATM, the statement
-probability = [1/6, 1/6, 1/3, 2/3] should be probability = [1/6,
-1/6, 1/3, 1/3]. (Thanks to Luis Soares)
-
-
-
Chapter 6
-
On page 164 and 165, the transformation equations have some errors in the text
-(not in the program). The equations should be:
-
Transformation 1
-
x1 = 0.85*x + 0.04*y
-
y1 = -0.04*x + 0.85*y + 1.6
-
Transformation 2
-
x1 = 0.2*x - 0.26*y
-
y1 = 0.23*x + 0.22*y + 1.6
-
Transformation 3
-
x1 = -0.15*x + 0.28*y
-
y1 = 0.26*x + 0.24*y + 0.44
-
Transformation 4
-
x1 = 0
-
y1 = 0.16*y
-
(Thanks to Dexter Edge, Fatih Kürşat Cansu, Toshiaki Kurokawa and Twitter @mkamimura)
-
-
-
Chapter 7
-
On page 195, an import is missing - SympifyError used later in the
-try..except block. The initial import statement should hence be:
Download the Anaconda Python 3.4 installer
-and start the installation by executing bash <path/to/installer>:
-
-Welcome to Anaconda3 2.1.0 (by Continuum Analytics, Inc.)
-
-In order to continue the installation process, please review the license
-agreement.
-Please, press ENTER to continue
->>> ENTER
-
-The “Anaconda END USER LICENSE AGREEMENT” will be displayed. Once you have read through it, type in “yes” to continue the installation:
-Do you approve the license terms? [yes|no]
-[no] >>> yes
-
-Anaconda3 will now be installed into this location:
-/home/testuser/anaconda3
-
- - Press ENTER to confirm the location
- - Press CTRL-C to abort the installation
- - Or specify an different location below
-
-
If you press ENTER above, the installation will start:
-
-[/home/testuser/anaconda3] >>>
-PREFIX=/home/testuser/anaconda3
-installing: python-3.4.1-4 ...
-installing: conda-3.7.0-py34_0
-..
-
-creating default environment...
-installation finished.
-Do you wish the installer to prepend the Anaconda3 install location
-to PATH in your /home/testuser/.bashrc ? [yes|no]
-
-
We will type in “yes”:
-
-[no] >>> yes
-
-Prepending PATH=/home/testuser/anaconda3/bin to PATH in /home/testuser/.bashrc
-A backup will be made to: /home/testuser/.bashrc-anaconda3.bak
-
-
-For this change to become active, you have to open a new terminal.
-
-Thank you for installing Anaconda3!
-
-
Open a new terminal for the next steps.
-
-
Updating sympy
-
We will first install/update sympy to make sure we have sympy-0.7.6 installed:
-
-$ conda install sympy=0.7.6
-
-
-
-
Installing matplotlib-venn
-
Use the following command to install matplotlib-venn:
-
-$ pip install matplotlib-venn
-
-
-
-
Starting Python shell
-
Open a new terminal and type in idle3 to start the IDLE editor or
-python to start the Python 3.4 shell. You should now be able to run
-all the programs and try out new ones.
Download the Anaconda GUI
-installer for Python 3. Start the installation by double clicking on
-the .pkg file:
-
-
-
-
Click Next on the next two screens and accept the License Agreement:
-
-
-
-
You can choose to install the distribution either for your user only
-or for all users using this computer. We will go with the former:
-
-
-
-
The error message is a bug in the installer software. Just click it, and
-it will disappear. Click Continue to proceed.
-
-
-
-
Click "Install" to start the installation.
-
-
-
-
Click on "Close" to complete the installation.
-
Open the Terminal app and carry out the following steps.
-
-
Installing sympy
-
The installation may come with sympy already installed, but we want to
-make sure that we have at least 0.7.6, so we will install it using the
-command conda install sympy=0.7.6. This should update (if already
-installed) or install sympy to the 0.7.6 version.
-
-
-
Installing matplotlib-venn
-
To install matplotlib-venn, use the command pip install matplotlib-venn.
-
Your computer is now setup to run all the programs.
-
-
-
Starting Python shell
-
Open a Terminal and type idle3 to start the IDLE shell or
-python to start the Python 3 default shell.
Download the Anaconda GUI
-installer for Python 3. Start the installation by double clicking on
-the installer.
-
-
-
-
Click Next and accept the License Agreement on the next screen:
-
-
-
-
You can choose to install the distribution either for your user only
-or for all users using this computer. We will go with the former:
-
-
-
-
Next, choose the folder where you want Anaconda to install the programs:
-
-
-
-
Check the next two boxes so that you can invoke the Python shell and
-other programs from anywhere on the command prompt and any other
-programs will use the Python installed by Anaconda as the default:
-
-
-
-
Click on “Install” to start the installation:
-
-
-
-
-
-
-
-
-
-
Click on “Finish” to complete the installation.
-
Open a Windows command prompt and carry out the following steps.
-
-
Installing sympy
-
The installation may come with sympy already installed, but we want to
-make sure that we have at least 0.7.6, so we will install it using the
-command conda install sympy=0.7.6. This should update (if already
-installed) or install sympy to the 0.7.6 version.
-
-
-
Installing matplotlib-venn
-
To install matplotlib-venn, use the command pip install matplotlib-venn.
-
Your computer is now setup to run all the programs.
-
-
-
Starting Python shell
-
Open a windows command prompt and type idle to start the IDLE shell or
-python to start the Python 3 default shell.
The programs in the book and the proposed solutions are tested to run
-on Python 3.5, matplotlib 1.4.2, matplotlib-venn 0.11 and sympy
-0.7.6. The version numbers stated are the minimum requirements and the
-programs should also work with higher versions of the
-software. However, if there is any change, it will be noted
-accordingly here.
-
There are various ways of installing these required software but one
-of the easiest is to use the Anaconda Python 3 software distribution
-available freely for Microsoft Windows, Linux and Mac OS X.
I attended the PyCon Australia 2016 Education seminar held on 12th August at Melbourne, Australia.
-I loved the energy of the seminar and was great to hear about all the ways educators in Australia are
-using Python for their teaching. Here are some notes I took, which I also link with the videos. You can
-find all the videos here.
Hi everyone, I have uploaded the slides for my upcoming talk at the PyCon Education Summit. If you are coming to the talk, feel free to have a look at the slides and have any questions/comments ready for me.
-
The slides are made using Jupyter Notebook + nbconvert magic. Thank you to everyone who makes these things happen. You can see the slides notebook here.
-
As a PyCon special, No Starch Press has setup a discount code PYCONMATH code which will give you 30 % off my book, Doing Math with Python and is valid from May 26th - June 8th.
Hello everyone, I will be speaking at the PyCon AU education seminar coming August 12, 2016 at Melbourne, Australia (3.00 - 3.40 PM).
-
I have put up my in progress slides (PDF) and the demos as Jupyter Notebooks (Python 3), I plan to use during the talk on GitHub. If you are coming along, please let me know if there is anything specific I can share and discuss.
You can get both the updates when you install Anaconda 4.0 or updated
-your existing Anaconda installation:
-
-$ conda update conda
-$ conda update anaconda
-
-
I have so far verified both on Mac OS X and Linux. If you find any
-issues on Windows, please email me at
-doingmathwithpython@gmail.com or post your query/tip to any of the
-following community forums:
+
+ {# based on http://stackoverflow.com/questions/12764291/jinja2-group-by-month-year #}
+
+ {% for year, year_group in dates|groupby('date.year')|reverse %}
+ {% for month, month_group in year_group|groupby('date.month')|reverse %}
+
+ {%- block content -%}{%- endblock %}
+
+ {% if DISPLAY_FOOTER or DISPLAY_FOOTER is not defined %}
+
+
+ {% endif %}
+
+
+
+{% include 'analytics.html' %}
+
+
diff --git a/theme/blue-penguin/templates/category.html b/theme/blue-penguin/templates/category.html
new file mode 100644
index 0000000..3045b0e
--- /dev/null
+++ b/theme/blue-penguin/templates/category.html
@@ -0,0 +1,6 @@
+{% extends "index.html" %}
+{% block title %}{{ SITENAME }} | articles in the "{{ category }}" category{% endblock %}
+{% block ephemeral_nav %}
+
+ {{ ephemeral_nav_link(category, output_file, True) }}
+{% endblock %}
diff --git a/theme/blue-penguin/templates/index.html b/theme/blue-penguin/templates/index.html
new file mode 100644
index 0000000..68fd125
--- /dev/null
+++ b/theme/blue-penguin/templates/index.html
@@ -0,0 +1,16 @@
+{% extends "base.html" %}
+
+{% block content %}
+{% set date = None %}
+{% for article in articles_page.object_list %}
+{% if date != article.date.date() %}
+{% set first_article_of_day = True %}
+{% else %}
+{% set first_article_of_day = False %}
+{% endif %}
+{% set date = article.date.date() %}
+{% include "article_stub.html" %}
+{% endfor %}
+
+{% include "pagination.html" %}
+{% endblock %}
diff --git a/theme/blue-penguin/templates/page.html b/theme/blue-penguin/templates/page.html
new file mode 100644
index 0000000..c285678
--- /dev/null
+++ b/theme/blue-penguin/templates/page.html
@@ -0,0 +1,11 @@
+{% extends "base.html" %}
+
+{% block title %}{{ SITENAME }} | {{ page.title }}{% endblock %}
+
+{% block content %}
+
+
+
{{ page.title }}
+ {{ page.content }}
+
+{% endblock %}
diff --git a/theme/blue-penguin/templates/pagination.html b/theme/blue-penguin/templates/pagination.html
new file mode 100644
index 0000000..8823d33
--- /dev/null
+++ b/theme/blue-penguin/templates/pagination.html
@@ -0,0 +1,38 @@
+{# Use PAGINATION_PATTERNS or pagination may break #}
+{% if DEFAULT_PAGINATION and (articles_page.has_previous() or articles_page.has_next()) %}
+
+
+
I recently learned about a cool formula to calculate the number of
-trailing zeros in the factorial of a number. It has been a while since I
-wrote a program to do something like this. So, I decided to change that and
-write this blog post. Let's jump in.
-
In the spirit of wring various "calculators" in the book, we will
-write a "number of trailing zero" calculator. First up though, let's refresh
-some key relevant concepts.
-
Factorial: The factorial of a number, n denoted by n! is the product n*(n-1)*(n-2)...*1.
-For example, 5! = 5*4*3*2*1 = 120.
-
Trailing zeros: The trailing zeros of a number is the number of zeros at the end of a number. For example,
-the number 567100 has two trailing zeros.
-
Floor: The floor of a number is the greatest integer less than or equal to x. That is floor of 3.2 is 3
-and that of 3.5 is 3 and the floor of 3 is 3 as well.
-
Now, coming back to the focus of this post, this document at brilliant.org wiki
-explains the process in detail.
-
The key bit there in is this formula:
-
-
-
-
where, n is the number for whose factorial we want to find the number of trailing zeros.
-
The following Python program implements the above formula:
-
-import math
-
-
-def is_positive_integer(x):
- try:
- x = float(x)
- except ValueError:
- return False
- else:
- if x.is_integer() and x > 0:
- return True
- else:
- return False
-
-
-def trailing_zeros(num):
- if is_positive_integer(num):
- # The above function call has done all the sanity checks for us
- # so we can just convert this into an integer here
- num = int(num)
-
- k = math.floor(math.log(num, 5))
- zeros = 0
- for i in range(1, k + 1):
- zeros = zeros + math.floor(num/math.pow(5, i))
- return zeros
- else:
- print("Factorial of a non-positive non-integer is undefined")
-
-
-if __name__ == "__main__":
- fact_num = input(
- "Enter the number whose factorial's trailing zeros you want to find: "
- )
- num_zeros = trailing_zeros(fact_num)
- print("Number of trailing zeros: {0}".format(num_zeros))
-
-
When we run this program using Python 3, it will ask for the number whose factorial's number of trailing
-zeros we want to find and then print it out, like so:
-
-Enter the number whose factorial's trailing zeros you want to find: 5
-Number of trailing zeros: 1
-
-
If you enter a number which is not a positive integer, you will get an error message:
-
-Enter the number whose factorial's trailing zeros you want to find: 5.1
-Factorial of a non-positive integer is undefined
-Number of trailing zeros: None
-
-
Some key standard library functions we use in the above program are:
-
-
math.floor: This function is used to find the floor of a number
-
math.log: This function is used to find the logarithm of a number for a specified base (defaults to 10)
-
math.pow: This function is used to find out the power of a number raised to another
-
-
The above functions are defined in the math module.
-
Besides the above, we use the is_integer() function defined on a floating point object to check
-if the floating point object is actually an integer.
Once you download the solutions ZIP file, and extract it you will
-find the solutions for each chapter in the corresponding sub-directory.
-
-
-
-
The PDF file contains explanations for each of the solutions
-similar to the explanations for the programs in the book.
-
Before you can try the programs out, you will have to open them first in IDLE.
-Let's consider the solution to a challenge posed in Chapter 6 to draw
-the Mandelbrot set - mandelbrot.py. Start IDLE and click on the menu item File >
-Open and navigate to the location where you extracted the directory
-above and open the file mandelbrot.py.
-
-
-
Snapshot of the source code
-
-
-
Running the program
-
To run the program, click on Run > Run Module and you should see
-the Mandelbrot set in the matplotlib window.
-
-
-
Mandelbrot set
-
-
All the solutions should be ready to run, try them out, make changes
-to experiment and let me know what you come up with!
-
Email me at doingmathwithpython@gmail.com or post your query/tip to any of the
-following community forums:
I spoke at the PyCon Australia Education Seminar on August 12, 2016. The video of the talk is now up.
-Thanks to Next Day Video!
-
The PDF slides and the demos as Jupyter Notebooks (Python 3) are here. I have some instructions to download them and try them out. If you face any issues, or have a question, please let me know.
-
Thank you to all the PyCon Australia organizers and the Education seminar organizers for a great mini conference
-and the opportunity to be a part of it.
Readers have shared how they are finding Doing Math with Python by
-posting reviews on Amazon and their own blog. You can view all of them
-on the Reviews page.
-
Some readers have also been kind enough to let me know personally how the book
-has helped them to restart their programming, or looking at something
-they have been putting off. As the author, I think this is the highest
-level of appreciation that I could have hoped for.
-
Recently, Aaron Meurer (the lead developer of SymPy) mentioned the
-book in an episode of
-Podcast.__init__ titled "SymPy with Aaron Meurer". If you are curious
-to learn more about SymPy, I would recommend listening to it.
-
I am curious to hear more. If you want to get in touch personally,
-please do so via any of the following channels: