Quantcast
Channel: fill na according to certain conditionals of other columns - Stack Overflow
Browsing all 3 articles
Browse latest View live

Answer by Vladimir Fokow for fill na according to certain conditionals of...

You can first left-merge two dataframes (to align them), and then use np.select:result = df1.merge(df2, on=['State', 'Municipality'], how='left')condlist = [result['Date of...

View Article



Answer by Mike for fill na according to certain conditionals of other columns

import pandas as pddf1 = pd.DataFrame({'State': ['Aguascalientes', 'Jalisco', 'Jalisco', 'Jalisco'],'Municipality': ['Aguascalientes', 'Chapala', 'Chapala', 'Chapala'],'Date of Project': ['2003',...

View Article

fill na according to certain conditionals of other columns

I have the following table:StateMunicipalityDate of ProjectPoverty (year)AguascalientesAguascalientes2003JaliscoChapala2004JaliscoChapala2010JaliscoChapala2015In it I have to fill the column poverty...

View Article
Browsing all 3 articles
Browse latest View live




Latest Images