Skip to content

Instantly share code, notes, and snippets.

View lucharo's full-sized avatar
🪐

Luis Chaves Rodriguez lucharo

🪐
  • London
  • 07:19 (UTC +01:00)
View GitHub Profile
@lucharo
lucharo / marimo-csv-column-picker.py
Created March 20, 2025 14:30
Marimo Notebook to Pick CSV Columns: Heya, as part of my work I receive client data in CSVs that are meant to follow a strict blueprint (column names, data types, etc). Client can be a bit unreliable in that regard and send over column names in different languages or with typos. Instead of manually checking each column and adjusting the names ma…
# /// script
# [tool.marimo.runtime]
# auto_instantiate = false
# ///
import marimo
__generated_with = "0.11.20-dev10"
app = marimo.App(width="medium")
@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');