Skip to content

Instantly share code, notes, and snippets.

View Tikondwe138's full-sized avatar
💯
grinding in grace

Tikondwe Mathias Kaonga Tikondwe138

💯
grinding in grace
View GitHub Profile
@Tikondwe138
Tikondwe138 / plot_customer_demographics.py
Created May 25, 2025 01:20
Generates 2 quick charts using Plotly — age distribution + gender pie.
import plotly.express as px
def plot_age_distribution(df):
return px.histogram(df, x='Customer Age', nbins=20, title='Customer Age Distribution')
def plot_gender_pie(df):
return px.pie(df, names='Customer Gender', title='Customer Gender Split')
@Tikondwe138
Tikondwe138 / sample_invoice_generator.py
Created May 25, 2025 01:19
Generates a PDF invoice from simple sales data.
from reportlab.pdfgen import canvas
def generate_invoice(filename, client_name, items):
c = canvas.Canvas(filename)
c.drawString(100, 800, f"Invoice for {client_name}")
y = 750
for item, price in items:
c.drawString(100, y, f"{item}: ${price}")
y -= 20
c.save()