help: pandas and 2d table

2024-04-12 Thread jak via Python-list

Hi everyone.
I state that I don't know anything about 'pandas' but I intuited that
it could do what I want. I get, through the "read_excel" method, a
table similar to this:

  obj| foo1 foo2 foo3 foo4 foo5 foo6
  ---
 foo1|   aa   ab   zz   ad   ae   af
 |
 foo2|   ba   bb   bc   bd   zz   bf
 |
 foo3|   ca   zz   cc   cd   ce   zz
 |
 foo4|   da   db   dc   dd   de   df
 |
 foo5|   ea   eb   ec   zz   ee   ef
 |
 foo6|   fa   fb   fc   fd   fe   ff


And I would like to get a result similar to this:

{
'zz':[('foo1','foo3'),
  ('foo2','foo5'),
  ('foo3','foo2'),
  ('foo3','foo6'),
  ('foo5','foo4')
 ]
}

Would you show me the path, please?
Thank you in advance.

--
https://mail.python.org/mailman/listinfo/python-list


Re: How to Add ANSI Color to User Response

2024-04-12 Thread Gisle Vanem via Python-list

Pierre Fortin wrote:


Over the years, I've tried different mechanisms for applying colors until
I got my hands on f-stings; then I created a tiny module with all the
colors (cR, cG, etc) which made my life so much simpler (attached).


Attachments are stripped off in this list.
It would be nice to see this tiny module of yours.
An URL or attach as inline text please.
--
https://mail.python.org/mailman/listinfo/python-list