I have a pyspark dataframe that looks like (a massively larger version of) the following:
+---+---+----+----+ | id| t|type| val| +---+---+----+----+ |100| 1