Created
June 24, 2025 18:50
-
-
Save rodigu/a51821116eadae34fd607bd3a6026ef8 to your computer and use it in GitHub Desktop.
a python one liner featuring the walrus operator
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(a:=df.melt(value_vars=[qtt, val], id_vars=[moy, par, ven], var_name='type')).assign(**{mnt:a[moy] + '-' + a['type']})[[mnt,par,ven,'value']].pivot(columns=[mnt], index=[par,ven], values='value').to_csv('73-1.csv') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment