Daily Archives: September 1, 2022
Django database optimization
The Django ORM makes interacting with the database a breeze, but without due care can also lead to poor performance. Example models Let’s say we have 2 very simple models, an Artist and her Artwork: Fetching artworks for each artist Imagine we had a user listing endpoints (for example in a Django rest framework API), […]
Pandas Snippets
Imputing missing values From the mean of a feature Country Name YEAR GDP ARUBA 1965 NULL ARUBA 1966 5.872478e+08 Say you have a dataframe for GDP by `Country Name` for each `year`, but some years are missing values. One way to deal with the missing values is to fill them in with the mean GDP […]
Deploying Imageproxy with AWS Fargate
imgproxy is a fast and secure standalone server for resizing and converting remote images. The main principles of imgproxy are simplicity, speed, and security. I wanted to use imgproxy with AWS to serve images up from an s3 bucket and have it also sit behind a Cloudfront distribution. At the time, I didn’t see any […]