Posts with the Python tag

Making a dumb smart light switch with a Raspberry Pi Pico

Python Microcontrollers Electrical engineering

19 November, 2024

– How I made a dumb smart switch with a Raspberry Pi Pico to control a Philips Hue smart light.



Flickering-flame LED effect using MicroPython on a Raspberry Pi Pico

Python Microcontrollers Electrical engineering

8 September, 2024

– This post describes how to wire up an electrical circuit and write a simple MicroPython script to deploy onto a Raspberry Pi Pico to create a flickering-flame LED effect.



How to develop and test a minimal API in Python with Flask

Python Software engineering Flask

11 April, 2023

– This post describes how to develop and test an API in Python with Flask. The API is minimal and self-contained, with very few dependencies beyond the Python standard library.



Using the GitHub API to find open-source projects looking for contributions

Python git

19 March, 2022

– I often read that a great way to get better at programming is to contribute to open-source projects. The problem is, open-source projects that are looking for help aren't all that easy to find. To find some leads on such projects, we can use the GitHub API.



Simple logistic regression with Python

Python Statistics and data science

18 February, 2021

– Logistic regression is used to predict a binary response. Let's see how to use Python to construct a logistic regression model that'll tell us which factors affected the passengers' chance of survival.



Regression case study part two: New Zealand's greenhouse gas emissions

Python Statistics and data science

15 February, 2021

– In part two, we dive deeper into some aspects of regression modelling, including multiple regression and evaluating model fit.



Regression case study part one: New Zealand's greenhouse gas emissions

Python Statistics and data science

31 January, 2021

– This is the first of two posts describing the development and evaluation of a regression model of NZ's greenhouse gas emissions.



Statistical interactions between variables with Python

Python Statistics and data science

25 January, 2021

– A statistical interaction occurs when the effect of one variable is moderated by another variable. Here, we'll show how the relationship between a car's fuel efficiency and engine displacement changes with the number of cylinders.



Simple Pearson correlation with Python

Python Statistics and data science

24 January, 2021

– The Pearson correlation coefficient measures the relationship between two continuous variables. We'll show how to obtain a Pearson correlation coefficient in Python.



Simple chi-squared test with Python

Python Statistics and data science

21 January, 2021

– The chi-squared test is used to determine the statistical significance of a categorical explanatory variable's effect on a categorical response variable. We'll show to how to conduct a simple chi-squared test in Python.



Simple ANOVA with Python

Python Statistics and data science

20 January, 2021

– In this quick tutorial, we describe how to conduct a simple ANOVA statistical test on the iris dataset with Python.



Leaflet maps in Django with model-backed geoJSON data

Python Django GIS Leaflet geojson

2 December, 2020 (updated 9 April, 2021)

– We can create Leaflet maps with simple location data, using only the default Django models and a home-made geoJSON serialiser. Let's avoid bloated geographical libraries and see how lightweight we can get our maps to be.



Setting environment variables for Django in Linux

Python Django Linux

22 September, 2020

– Setting environment variables for your Django web-application is pretty simple: here's how you do it.



Behavioural psychology and Python: Part 1

Python Statistics and data science

24 February, 2020

– In The Undoing Project, Michael Lewis's excellent book about two groundbreaking behavioural psychologists, we get a glimpse at some of the mechanisms that drive our judgements and decisions. By coming up with interesting questions to pose to ...