the way I did this was:
self.cleaned = []
for a in self.P[-1]:
for b in a:
for c in b:
for d in c:
self.cleaned.extend(d)
which is quite ugly and unintuitive, is there a proper way of doing this? maybe using numpy