I have a Pandas dataframe like :
p1 p2 p3
t1 a b c
t2 d e f
t3 g h i
and I want either several df (or one xarray), one for each t(y axis) like:
for t1: the value of pn minus pn for t1 :
p1 p2 p3
p1 a-a b-a c-a
p2 a-b b-b c-b
p3 a-c b-c c-c
idem for t2, t3 and so on...
I have made a loop like
for t in tlist :
for p in plist :
for q in plist :
res = p - q
but it's hugly and slow.
So if anyone know a pythonic way to do that, [s]he's very welcome !