Skip to content

Instantly share code, notes, and snippets.

View lucharo's full-sized avatar
🪐

Luis Chaves Rodriguez lucharo

🪐
  • London
  • 00:43 (UTC +01:00)
View GitHub Profile
@lucharo
lucharo / harrypotterwords.md
Last active June 28, 2024 11:35
Harry Potter books average words per page

Harry Potter Series Word Count and Page Numbers

Many people have read the Harry Potter series hence I consider it a good measure for readers to estimate how long a blogpost based on word count (rather than reading time).

Word Counts and Page Numbers

Book Words Pages
Harry Potter and the Philosopher’s Stone 76,944 223
Harry Potter and the Chamber of Secrets 85,141 251
Harry Potter and the Prisoner of Azkaban 107,253 317
a b c
1 0 One
2 0 Two
3 0 Three
import pandas as pd
pd.DataFrame({'a': [1,2,3], 'b': [0,0,0], 'c': ['One', 'Two', 'Three']})
@lucharo
lucharo / hide_cell.py
Created March 12, 2021 18:10
nb2medium-article
# %hide-cell
print("This cell won't make it to the final document")
@lucharo
lucharo / hide_output.py
Created March 12, 2021 18:10
nb2medium-article
# %hide-output
print("This code will be shown, but it's output won't")
@lucharo
lucharo / hide_source.py
Created March 12, 2021 18:10
nb2medium-article
# %hide-source
print("This code won't be shown, but it's output will")
@lucharo
lucharo / seaborn.py
Created March 12, 2021 18:10
nb2medium-article output
import seaborn as sns
x = np.arange(0, 10, 0.1)
y = np.sin(x)
sns.scatterplot(x = y,y = x);
@lucharo
lucharo / matplotlib.py
Created March 12, 2021 18:10
nb2medium-article output
import numpy as np
import matplotlib.pyplot as plt
x = np.arange(0, 10, 0.1)
y = np.sin(x)
plt.plot(x,y);
@lucharo
lucharo / nb2medium-upload.py
Created March 12, 2021 18:10
nb2medium-article output
from nb2medium.upload import nb2medium
nb2medium(title = 'My First Article', notebook = 'path/to/notebook.ipynb');
@lucharo
lucharo / fig_layout.py
Last active October 6, 2020 16:42
Populate plotly.graph_objects.Figure['layout']
fig['layout'] = go.Layout(
font = {'size' : 14},
plot_bgcolor = 'white',
xaxis = {'showline': True,
'visible': True,
'range': (0, data['Value'].max()),
'title_text': 'Production Quantity (tonnes)' # title of the x axis
},
yaxis = {'showline': False,
'visible': True, # to show the title