python - Fusion Two dataframes into one dataframe -


i have 2 dataframes data_df , taux_df. use condition select data taux_df , put new field on data_df
use data_df['taux technique']=(indexed_taux_df.loc[data_df['date effet'].dt.year.where(data_df['duree (mois)']>120),['>10 ans']]).values have result more 10 years values

this column contains many nan values .i want fill nan values dataframe contains values in place of nan values. use doesnt workdata_df['taux technique'].fillna(indexed_taux_df.loc[data_df['date effet'].dt.year.where(data_df['duree (mois)']<120),['<10 ans']]) this picture of taux_df not indexed enter image description here have error

valueerror: invalid fill value class 'pandas.core.frame.dataframe' data_df['duree (mois)'] number of months in period use function have data_df['date effet'].data_df['date fin effet'].dt.month in taux_df have rate of every period example if have period less 10 years on 2014 should have result 0.34600 have select data if have period less 120 month select column ['<10 ans'] or opposite , store results on 1 column on data_df['taux technique'] when use indexed_taux_df.loc[data_df['date effet'].dt.year.where(data_df['duree (mois)']<120),['<10 ans']]and indexed_taux_df.loc[data_df['date effet'].dt.year.where(data_df['duree (mois)']>120),['>10 ans']]i have dataframes contains nan values opposites for less 10 years values


Comments

Popular posts from this blog

javascript - jQuery: Add class depending on URL in the best way -

caching - How to check if a url path exists in the service worker cache -

Redirect to a HTTPS version using .htaccess -