This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() |