Skip to content

Instantly share code, notes, and snippets.

View Thiagobc23's full-sized avatar

Thiago Bernardes Carvalho Thiagobc23

View GitHub Profile
@Thiagobc23
Thiagobc23 / leo_gf.csv
Created September 3, 2022 18:13
Data for the Leonardo Dicaprio Chart
year gf gf_age leo_age
1998 Gisele Bundchen 18 24
1999 Gisele Bundchen 19 25
2000 Gisele Bundchen 20 26
2001 Gisele Bundchen 21 27
2002 Gisele Bundchen 22 28
2003 Gisele Bundchen 23 29
2004 Bar Refaeli 20 30
2005 Bar Refaeli 21 31
2006 Bar Refaeli 22 32
@Thiagobc23
Thiagobc23 / jitter.py
Last active August 13, 2022 20:22
dummy data with a numerical and a categorical field
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.lines import Line2D
import seaborn as sns
colors = {'bg':'#3D3C42', 'data':'#FEFBF6', 'data2':'#A6D1E6'}
# data
url = 'https://gist.githubusercontent.com/Thiagobc23/0bc5c5f530e8f8fd98710fe1ccb407ce/raw/4e084668a83ab9d0a0ace1425742835a0563bcef/quality.csv'
id,Product,Quantity (Kg),Value per Kg,Cost per Kg,Date,Production Timeliness,Packing Timeliness,Shipping Timeliness,Delivery Timeliness,Client,Channel,Promotion,Returned
1,Cheddar,53.2,61.07,0.88,2/24/2021,4,2,1,1,Death Star II,Fax,,
2,Gouda,101.7,181.17,0.83,1/18/2021,18,2,2,1,Xavier's Academy,Fax,,
3,Feta,24.3,27.48,0.87,6/1/2021,34,3,0,9,Hogwarts,Fax,,
4,Mozzarella,140.1,102.83,0.84,1/14/2021,43,2,1,14,Death Star II,Phone,,
5,Parmigiano-Reggiano,48.3,188.53,0.9,5/22/2021,31,1,2,9,Death Star II,Phone,,
6,Mozzarella,14.4,162.78,0.9,5/21/2021,14,1,0,15,Dunder Mifflin,Telepathy,Psychedelic Cheese,
7,Parmigiano-Reggiano,43.9,120.86,0.94,3/7/2021,11,4,2,9,Gondor,Website,,
8,Feta,18.4,80.56,0.85,1/16/2021,45,1,2,2,Dunder Mifflin,Phone,,
9,Roquefort,109.6,195.14,0.89,1/27/2021,21,2,2,7,Del Boca Vista,Fax,,
@Thiagobc23
Thiagobc23 / anand.csv
Created January 16, 2022 20:37
Viswanathan Anand Historical Fide Rating - Standard
Rating Date
2751 2022-01-01
2751 2021-12-02
2751 2021-11-03
2753 2021-10-04
2753 2021-09-05
2753 2021-08-06
2753 2021-07-07
2753 2021-06-08
2753 2021-05-09
@Thiagobc23
Thiagobc23 / caruana.csv
Created January 16, 2022 20:20
Fabiano Caruana Historical Fide Rating - Standard
Rating Date
2792 2022-01-01
2792 2021-12-01
2791 2021-11-01
2800 2021-10-01
2800 2021-09-01
2806 2021-08-01
2806 2021-07-01
2820 2021-06-01
2820 2021-05-01
@Thiagobc23
Thiagobc23 / nepo.csv
Created January 10, 2022 02:03
Ian Nepomniachtchi FIDE Rating - Standard
Rating Date
2773 2022-01-01
2782 2021-12-01
2782 2021-11-01
2782 2021-10-01
2792 2021-09-01
2792 2021-08-01
2792 2021-07-01
2792 2021-06-01
2792 2021-05-01
@Thiagobc23
Thiagobc23 / magnus.csv
Last active January 10, 2022 02:04
Magnus Carlsen Historical Fide Rating - Standard
Rating Date
2865 2022-01-01
2856 2021-12-01
2855 2021-11-01
2855 2021-10-01
2855 2021-09-01
2847 2021-08-01
2847 2021-07-01
2847 2021-06-01
2847 2021-05-01
@Thiagobc23
Thiagobc23 / donut.py
Last active November 3, 2021 01:58
Donut chart with Matplotlib
import matplotlib.pyplot as plt
data = [87,13]
fig, ax = plt.subplots(figsize=(6, 6))
wedgeprops = {'width':0.3, 'edgecolor':'black', 'linewidth':3}
ax.pie(data, wedgeprops=wedgeprops, startangle=90, colors=['#5DADE2', '#515A5A'])
plt.title('Worldwide Access to Electricity', fontsize=24, loc='left')
@Thiagobc23
Thiagobc23 / circular_progress_bar.py
Created November 3, 2021 01:53
Circular progress bar with Matplotlib
from math import pi
import numpy as np
from matplotlib.patches import Patch
from matplotlib.lines import Line2D
# data and variables
data = [82, 75, 91]
startangle = 90
colors = ['#4393E5', '#43BAE5', '#7AE6EA']
@Thiagobc23
Thiagobc23 / ridge_plot.py
Created November 2, 2021 04:38
Ridge plot with Seaborn
import matplotlib.pyplot as plt
import seaborn as sns
import pandas as pd
# DATA
url = 'https://gist.githubusercontent.com/Thiagobc23/4ccb4ea1c612d9d68921bf990ce28855/raw/07af955c17d1816aba58dea74d65f60210702a15/film.csv'
df = pd.read_csv(url, index_col='ID')
# Theme
sns.set_theme(style="white", rc={"axes.facecolor": (0, 0, 0, 0), 'axes.linewidth':2})