Naming Python constants and functions
Functions should start with a _single_leading_underscore where they are only intended to be used within a given function/Class. Doing this, from M import * does not import objects whose name starts...
Functions should start with a _single_leading_underscore where they are only intended to be used within a given function/Class. Doing this, from M import * does not import objects whose name starts...
Things held as configuration variables and secrets in GitHub must be defined as environment variables in the GitHub Actions workflow in order to be able to use them in a script. Configuration vari...
Use: - name: Install Microsoft ODBC run: sudo ACCEPT_EULA=Y apt-get install msodbcsql18 -y Ref (NB: additional steps, on port mapping, don’t seem to be necessary. This is an abbreviated versio...
Putting an exclamation mark before a filename excludes that file from being ignored. !file1.py But where an entire directory is being ignored, this exclusion won’t work. I.e. for: my-app/ └──...
Create virtual environment named env inside current directory: python -m venv env Create virtual environment named env inside current directory using a specific version of Python: python -3.13 -m ...
distutils requires Microsoft C++ Build Tools. When installing this, only the first option needs to be selected (desktop development, C++ developement tools (or similar naming)).
Converting warnings of a particular category from a particular module can be done using: import warnings warnings.filterwarnings("error", category=UserWarning, module="seaborn") (Ref.)
When doing memory-intensive operations in VSCode - e.g. working with large pandas dataframes - the kernel can crash with the following error: The kernel crashed while executing code in the current...
Attempting to upload large dataframes can result in the following error: PendingRollbackError: Can't reconnect until invalid transaction is rolled back. Please rollback() fully before proceeding ...
Images can be inserted using:  Ref. Spaces need to be URL-encoded in GitHub Markdown. Spaces are encoded as %20%.