Deutsch   English   Français   Italiano  
<AqOdnQN9ObYzPUL_nZ2dnUU7_83NnZ2d@giganews.com>

View for Bookmarking (what is this?)
Look up another Usenet article

Path: ...!buffer1.nntp.dca1.giganews.com!buffer2.nntp.dca1.giganews.com!news.giganews.com.POSTED!not-for-mail
NNTP-Posting-Date: Tue, 26 Jul 2022 03:07:10 -0500
Newsgroups: fr.comp.lang.python
Subject: Re: Comparer deux colonnes avec pandas
X-poster: PEAR::Net_NNTP v1.5.0 (stable)
From: gigi123 <nospam_giannivolturno5@gmail.com.invalid>
References: <duOdnQj_K-DtGkP_nZ2dnUU7_83NnZ2d@giganews.com> <tbo20m$1pnml$1@dont-email.me>
Content-Type: text/plain; charset=windows-1252
Content-Transfer-Encoding: 8bit
Organization: !No_Organization!
Message-ID: <AqOdnQN9ObYzPUL_nZ2dnUU7_83NnZ2d@giganews.com>
Date: Tue, 26 Jul 2022 03:07:10 -0500
Lines: 32
X-Usenet-Provider: http://www.giganews.com
X-Trace: sv3-2I7omBpa+unh29iSx8ci3gPz1cwtDCRcEYbIoDQtXbmZmnIR6EFMiI7WkeQ2jJCc+Smoz3FKk2mHG4I!56a0RKLSwcxVGF7i9+weC7weCecQu/YCU7DuYNNnFqLmAnlHQRwqFxm+CjCsgdlfZ2XqRIiyIbrV
X-Complaints-To: abuse@giganews.com
X-DMCA-Notifications: http://www.giganews.com/info/dmca.html
X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers
X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly
X-Postfilter: 1.3.40
Bytes: 2141
X-Original-Bytes: 2048

Le mardi 26 Juillet 2022 à 08:36 par Carboleum :
> Le 25-07-22 Í  14:07, gigi123 a écrit :
>> Bonjour,
>> 
>> VoilÍ  je me trouve coincé sur un sujet concernant python.
>> Je travaille
>> actuellement avec Pandas. J'aimerais comparer deux colonnes dans une
dataframe
>> (que j'ai déjÍ  crée), si le résultat de la
>> première colonne est égale Í  la
>> deuxième colonne, alors la réponse sera la 4ème colonne.
>> 
>> 
>> 
> tu peux utiliser numpy.where(df.colonne1 == df.colonne2, df.colonne4)
> 
> 
> 
> 
> --
> L'absence de virus dans ce courrier électronique a été
> vérifiée par le logiciel antivirus Avast.
> https://www.avast.com/antivirus
Merci pour ta réponse. 
J'ai essayé malheureusement ça ne fonctionne pas. 
Erreur -> Can only compare identically-labeled DataFrame objects

test = np.where(col1==col2,col3)

Col1 c'est une dataframe pour la première colonne
Col2 """"
Col3 """""