Nov-25-2020, 05:24 PM
(This post was last modified: Nov-25-2020, 05:24 PM by eddywinch82.)
Hi there,
I use the following lines of Code in a full Code, to append Rows, based on a Column Value, to a DataFrame I have :-
It does to the end of the DataFrame, but I want the two Rows duplicated, to be inserted at Index Numbers 2 and 3, i.e. directly underneath the source Rows.
And the 'LOCATION' Column values, in the duplicated Rows, to say 'Duxford' instead of 'Podington'.
Could someone here, tell me how to do this ?
Any help would be much appreciated
Regards
Eddie Winch
I use the following lines of Code in a full Code, to append Rows, based on a Column Value, to a DataFrame I have :-
is_dux = display['LOCATION'] == 'Podington' display_try = display[is_dux] display=display.append(display_try)It appends the Rows who's Row Data I want to duplicate, to the output DataFrame in Pandas.
It does to the end of the DataFrame, but I want the two Rows duplicated, to be inserted at Index Numbers 2 and 3, i.e. directly underneath the source Rows.
And the 'LOCATION' Column values, in the duplicated Rows, to say 'Duxford' instead of 'Podington'.
Could someone here, tell me how to do this ?
Any help would be much appreciated
Regards
Eddie Winch
