I Made this nice plot for my mother’s birthday (which is today, 4th December) and I thought it would be nice to share it. import numpy as npimport matplotlib.pyplot as pltdef heart_plotter(precision): t = np.linspace(0, 60, precision) X = 1/100*(-t**2 + 40*t + 1200)*np.sin(t/90) Y = 1/100*(-t**2 + 40*t + 1200)*np.cos(t/60) Y_1 = 1/100*(-t**2 + […]
Category: Python
A Python Rubik’s Cube Solver: Part 1
Finally, I was able to get my own GitHub account, which you can find at https://github.com/mattiagiuri, and my first repository is one containing my latest project: a Rubik’s cube solver in Python. If you want, you can check it out and have fun with your Rubik’s cube solving tasks. How does it work? First, I […]
A Very Notorious Problem, But In 3D
I’ve already made an article on the 2D version of this problem, if you want to check it out before this one, you can visit https://www.mattiagiuri.com/2020/04/21/a-very-notorious-problem/. Now, the 3D version says: if you have 3 reals x, y, z chosen randomly between 0 and 1, what’s the probability that It’s important to notice that any […]
Lorenz Attractor In Python Graphed
In my school course ‘Python For Physics’ we had to choose among some topics to study and implement in Python, and I and my colleague decided to go for the Lorenz Attractor equations. The Lorenz System is a system of differential equations which generates a very chaotic plot, where chaotic means that little variations may […]
Hearts Equations In Math
In this article, I’ll show you five different equations you can use to plot your own heart. Let’s start with the simplest: I think this is the most classic of the five I’m going to show you. If you prefer one which is a little bit thinner, there is this one: On the other hand, […]
Plotting Waves In Python
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 […]
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 […]
A Random Forest For The Iris Dataset
Yesterday we talked about a Decision Tree Classifier making a prediction on the Iris dataset, now let’s see how an ensemble of decision trees can help each other making a more accurate prediction. The main fact about ensemble methods is that each model is trained on a different subset of the training set. If the […]