Jul-08-2021, 06:32 PM
(This post was last modified: Jul-08-2021, 06:32 PM by eddywinch82.)
I have modified that part of the Code, to the following :-
The hashed out lines of code, does the same, but for the last 4 letters of the first word in rows.
Anyone any ideas, how to ignore the comma, at the end of the first word in the rows ?
Regards
Eddie Winch
remove=[] for i,row1 in final_df_.iterrows(): loc = row1[0] and row1[0][:4] #loc = row1[0] and row1[0][-4:] date = row1[1] for j,row2 in final_df.iterrows(): if loc in row2[0] and date==row2[1] or loc in row2[0][:4] and date==row2[1]: #if loc in row2[0] and date==row2[1] or loc in row2[0][-4:] and date==row2[1]: remove.append(i) final_df_=final_df_.drop(final_df_.index[remove]) final_df_.reset_index(drop=True,inplace=True) full_df=pd.concat([final_df,final_df_],axis=0)This matches the first word in rows in the other DataFrame, where the first 4 letters are the same.
The hashed out lines of code, does the same, but for the last 4 letters of the first word in rows.
Anyone any ideas, how to ignore the comma, at the end of the first word in the rows ?
Regards
Eddie Winch