The supporting repository and code file is: https://github.com/StatsGary/PyHacks-Tutorials/blob/main/28_defaultdict.py. This is aimed as a short article to explain why you would want to use default dictionaries. What is a defaultdict I hear you ask? A defaultdict is a container like dictionary present in ...
NamedTuples are an excellent way to make your Python code more useful and readable. In short a NamedTuple is an alternative to the built-in tuple . This extension type enhances standard tuples so that their elements can be accessed by both their attribute name and the positional index. This is really ...
I love Nottingham Forest and have been trying to find a way to include them in one of my tutorials, as they are in the play-offs to go into the top flight leagues. This tutorial allows you to download images from Selenium and automate Google Chrome. Can I get a ...
When I first started programming in Python this used to trip me up all the time. Hopefully through my pain I have managed to find a way to convey just how simple this concept is. Working with args These functions allow you to extend your function massively, as when you ... [...Read more...]
This assumes you know how to programme in Python and know a little about n-dimensional arrays and how to work with them in numpy (don’t worry if you don’t I got you covered). PyTorch is a pythonic way of building Deep Learning neural networks from scratch. This is ...
I have been working hard to compile a whole set of videos that help you to understand the core data structures that underpin the really powerful Python programming language. Tuples For tuples, you can view the code here, on GitHub. I would recommend you watch the video, pull the code ...
Learn how object orientated programming works in Python. The video attached shows how to build a simple Transformers battle game and familiarise yourself with the knowledge of classes. This video takes you through: Classes and initialisation Methods Properties / Attributes Inheritance Instead of me writing all this down, it is better ...
This tutorial has been borne out of the ability to port my development environments around. Most times I have to create requirements files to specify the dependent packages to be created in my virtual environments. Creating virtual environments To learn how to create virtual environments, see below: Anaconda: https://hutsons-hacks....
I am proud to announce my seventh package for you lovely R folks. This time it is a collection of datasets aimed at giving people in healthcare, and beyond, some solid examples for using with R. There remains a few excellent packages for this, such as mlbench, but they are ... [...Read more...]