This Friday, I attended the Python Pizza micro conference in Hamburg. It was a very nice, welcoming and informative event. I liked the broad perspectives on how-to, learning and diversity. The topics of the talks were very accessible and mainly experience based.
Some of the technical things I took out:
“Streamlit: Making Data Shine in Minute” (Alessandro Romano) showed me that Streamlit may be the tool I need to quickly create data dashboards without getting into webdev details.
“Introducing the ORMIR community and the book ‘Learn Python with Jupyter’” (Serena Bonaretti) helped me to better understand the evolving relation between open source, open science, research and learning.
“Choose HTMX and avoid learning too much JavaScript” (Martin Borus) demonstrated once more that I should start to experiment with htmx. I run the repository code in Codespaces later and want to try FastAPI and async web page element reloading.
The friendly environment and some nice exchanges about data science, Python, and open source projects over delicious pizza were really nice.
This was a Python Pizza conference. So I asked ChatGPT to draw a Pizza in Python, something it happily did.
ChatGPT message: draw a figure of a pizza in python in a jupyter notebook
This provided code for a pizza with peperoni. I tried to get a Vega-Altair version but this did not work out. So I stayed with the Matplotlib version and asked to have some pizza slices.
ChatGPT message: add slices to the matplotlib plot
Code
import matplotlib.pyplot as pltimport matplotlib.patches as patches# Create a figure and axisfig, ax = plt.subplots()# Draw the pizza circlepizza_circle = plt.Circle((0.5, 0.5), 0.4, color='brown', fill=True)ax.add_patch(pizza_circle)# Draw the cheese circle (a smaller circle on top of the pizza)cheese_circle = plt.Circle((0.5, 0.5), 0.35, color='yellow', fill=True)ax.add_patch(cheese_circle)# Draw pizza slicesnum_slices =8theta =360/ num_slicesslice_colors = ['orange', 'lightgreen', 'tomato', 'wheat', 'lightcoral', 'lightblue', 'sandybrown', 'lightpink']for i inrange(num_slices): slice_wedge = patches.Wedge((0.5, 0.5), 0.4, i * theta, (i +1) * theta, color=slice_colors[i], fill=True) ax.add_patch(slice_wedge)# Set aspect ratio to be equalax.set_aspect('equal', adjustable='box')# Set axis limitsax.set_xlim(0, 1)ax.set_ylim(0, 1)# Remove axis labels and ticksax.set_xticks([])ax.set_yticks([])ax.set_xticklabels([])ax.set_yticklabels([])# Set the titleplt.title("Delicious Pizza with Slices")# Show the plotplt.show()