I am trying to set part of two dataframes (static_df_1 and static_df_2) of same size (1000000 rows and 8 columns) equal to each other based on 4 conditions. However, I am unable to make them equal. i and j are two columns in each dataframe and sales are also another shared column in those two dataframes. My conditions are to set equal only those part of my two dataframe where 25 < i < 36 and 25 < j < 36. When I perform the below code, they are still different and not equal!
old_sales = static_df_1.loc[(static_df_1['i'] > 25 ) & (static_df_1['i'] < 36) & (static_df_1['j'] > 25 ) & (static_df_1['j'] < 36 )]['sales']
static_df_2.loc[(static_df_2['i'] > 25 ) & (static_df_2['i'] < 36) & (static_df_2['j'] > 25 ) & (static_df_2['j'] < 36 )]['sales'] = old_sales