I really like plotting waves in Python: there are many ways you can show interesting patterns both in 2D and 3D. I’m obviously using the numpy and matplotlib libraries to create and plot the functions. 2D Wave Plot I really wanted to try to reproduce Arctic Monkeys’ AM cover image, and that’s what I was […]
Tag: python
Plotting A Torus With Python
In geometry, a torus is a surface generated by revolving a circle in three-dimensional space about an axis that is coplanar with the circle. To make it simple, it has the form of a ring or of a donut. How can we plot it with Python? Well, matplotlib’s 3D plotting needs three coordinate arrays, so […]
A Python Biology Dictionary
Last year I had to prepare for a biology test, so I decided to combine business with pleasure and write my own biology dictionary on Python: it provided a brief definition and the pages on the book I had to see to find what I needed. Python Implementation from fuzzywuzzy import process import pandas as […]
Great Classic: Hanoi Tower
Tower of Hanoi consists of three pegs or towers with n disks placed one over the other. The objective of the puzzle is to move the stack to another peg following these simple rules. Only one disk can be moved at a time. No disk can be placed on top of the smaller disk. In […]
Python Sudoku Solver
Writing a sudoku solver is a great example to show how recursion works in Python. This particular technique is called ‘Backtracking’. Let’s see a possible implementation. How Sudoku Works There are 3 rules you have to follow when solving a sudoku: All the numbers in a row must be different; All the numbers in a […]
A Very Notorious Problem
One very famous programming challenge is: given a function which generates a random real number in the interval [0,1], calculate the value of pi. At first glance, it could seem that it could seem that the data and the request are completely different, but with a little math trick we can actually compute the value […]