Doing Math with Python

Apr 06, 2017

Doing Math with Python 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.

Humble Bundle

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!

Find this post useful? Please share.

Share on: Diaspora*TwitterFacebookGoogle+Email

Aug 16, 2016

Video: Doing Math with Python

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.

Find this post useful? Please share.

Share on: Diaspora*TwitterFacebookGoogle+Email

Aug 12, 2016

PyCon Australia 2016 Education Seminar

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

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)

Find this post useful? Please share.

Share on: Diaspora*TwitterFacebookGoogle+Email

Aug 06, 2016

PyCon Australia 2016 Education Seminar: Doing Math with Python

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

Find this post useful? Please share.

Share on: Diaspora*TwitterFacebookGoogle+Email

Jul 01, 2016

O'Reilly Webcast: Doing Math with Python

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

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.

Find this post useful? Please share.

Share on: Diaspora*TwitterFacebookGoogle+Email

May 29, 2016

Python 2016 Education Summit Notes

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/

Find this post useful? Please share.

Share on: Diaspora*TwitterFacebookGoogle+Email

May 26, 2016

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.

Find this post useful? Please share.

Share on: Diaspora*TwitterFacebookGoogle+Email

Apr 11, 2016

SymPy 1.0 and Anaconda 4.0 releases

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:

$ 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:

Find this post useful? Please share.

Share on: Diaspora*TwitterFacebookGoogle+Email

Feb 14, 2016

What readers are saying

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:

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.

Find this post useful? Please share.

Share on: Diaspora*TwitterFacebookGoogle+Email

Nov 18, 2015

Trying out the solutions in IDLE

Once you download the solutions ZIP file, and extract it you will find the solutions for each chapter in the corresponding sub-directory.

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.

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.

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:

Find this post useful? Please share.

Share on: Diaspora*TwitterFacebookGoogle+Email

Sep 11, 2015

Chapter code and Errata

You can find the chapter programs and snippets linked from the programs page. They should be free from any error mentioned on the errata page.

Stay in touch

You can stay connected with the book, its readers and me via the following channels:

You can contact me directly via:

Find this post useful? Please share.

Share on: Diaspora*TwitterFacebookGoogle+Email

Sep 02, 2015

Doing Math with Python 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 page for others.

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:

You can contact me directly via:

Find this post useful? Please share.

Share on: Diaspora*TwitterFacebookGoogle+Email

Aug 15, 2015

All chapters completed, off to the 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 page.

You can stay connected with the book, its readers and me via the following channels:

Find this post useful? Please share.

Share on: Diaspora*TwitterFacebookGoogle+Email

May 24, 2015

Introduction to "Doing Math with Python"

Hi all, this is the blog for my book "Doing Math with Python".

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 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:

Find this post useful? Please share.

Share on: Diaspora*TwitterFacebookGoogle+Email