Skip to content

You like 'Huey Lewis and the News'?

It's hip to be square -

Operations on squares, not objects.

Numpy is fantastic for vectorisation - and consequently so is Pandas. Also, so are some of my favourite tidyverse functions: mutate(), if_else() and across().

This means you have to think less about your data when it is in a tabular format, but more about how to represent your data abstractions inside a tabular format. You may think this is easy, but let's use the following example:

Python
1
2
3
4
5
6
7
8
9
from dataclasses import dataclass
from typing import Literal

@dataclass
class Gene:
    name: str
    start: int
    end: int
    strand: Literal[-1, 0, 1]

We have defined a simple Gene model, representing a gene on a chromosome with a name, coordinatedes, and orientation. But say I want to

Comments