Complicated Moments
fillna is not in-place by default: df['col'].fillna(0) returns a new Series. Use df['col'] = df['col'].fillna(0) or df.fillna({'col': 0}, inplace=True).
melt vs stack: melt converts specific value columns to rows (wide → long), keeping id columns. stack pivots the innermost column level into the row index. For expression data reshaping, melt is usually what you want.
groupby and the index: groupby('gene_id').agg(...) moves gene_id int
[Description truncada. Veja o README completo no GitHub.]