Path: ...!3.eu.feeder.erje.net!feeder.erje.net!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: jak Newsgroups: comp.lang.python Subject: Re: help: pandas and 2d table Date: Sat, 13 Apr 2024 23:35:57 +0200 Organization: A noiseless patient Spider Lines: 6 Message-ID: References: <8b63c74a-d8e5-4c3a-ac3e-b240c88b7dcb@wichmann.us> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Sat, 13 Apr 2024 23:35:58 +0200 (CEST) Injection-Info: dont-email.me; posting-host="2854b3bf011acad7d59e0d49c2f59463"; logging-data="3381092"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/HGdQoZ1gllgoON/UXal1u" User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Firefox/91.0 SeaMonkey/2.53.18.2 Cancel-Lock: sha1:VNpoCiFCREvxNXrMvlkGzAM13gI= In-Reply-To: Bytes: 1634 Stefan Ram ha scritto: > df = df.where( df == 'zz' ).stack().reset_index() > result ={ 'zz': list( zip( df.iloc[ :, 0 ], df.iloc[ :, 1 ]))} Since I don't know Pandas, I will need a month at least to understand these 2 lines of code. Thanks again.