I haven’t written a Substack newsletter for a while - it’s been the summer (and a hot one) and I haven’t felt very productive. But I have done a few things since my last newsletter and some new things have been happening in the Streamlit world.
Streamlit
Streamlit released version 1.12.0 in August and they have made a few changes. They seem to admit that creating graphs in Streamlit was difficult, which is a bit of an admission for an app that is aimed at Data Scientists who want to present their data. Anyway, they’ve updated their built-in graphs to make life easier and I’ll be looking at this later. You can see their blog post about the new release, here.
Streamlit has also introduced spacing between columns - not terribly exciting, maybe, but I’ve previously written about how to customize the column layout in Streamlit and so have updated this particular article with the new info (Customizing Streamlit Columns).
And on the subject of layout in Streamlit I’ve been looking at How to Create a Grid Layout in Streamlit and come up with a simple function that will create a grid layout that can be addressed as a two-dimensional array. So, say you want a 2x2 grid, you could write something like:
mygrid = make_grid(2,2)
and then to write something in the bottom right-hand cell you could do this:
mygrid[1][1].write("Hello")
PyScript
PyScript looks like a very useful new technology and I’ve already written a couple of tutorial pieces about it, already, which you may have seen in previous posts. I’ve now reflected a little on just how PyScript might be used in this short opinion piece: Hello PyScript.
And the article PyScript v. Flask: How to Create a Python App in the Browser or on a Server explores how the same app can be written as a Flask app or in PyScript and looks at the differences in approach and the result.
Wikipedia tables as a data source
I’ve also returned to Wikipedia as a source of data with the article How to Scrape and Clean Wikipedia Tables with Python and Pandas. While Wikipedia tables are designed for people to look at, not for processing with computers, with some help from Python and Pandas we can sort them out. I use the results of the 2021 Formula 1 season as an example.
I hope you find something useful in the articles above. Thanks for reading and if you’d like to see more of my work, please take a look at my web page on Github
.