Skip to content
Advertisement

Using the items of a df as a header of a diffeerent dataframe

I have 2 dataframes

JavaScript

and df2=

JavaScript

I want to use df1 as a header of df2 so that df1 is either the header of the columns or the first raw.

JavaScript

i have multiple columns so it will not work to do

df2.columns=["_A1-Site_0_norm", "_A1-Site_1_norm"]

I thought of making a list of all the items present in the df1 to the use df2.columns and then include that list but I am having problems with converting the elements in row 1 of df1 of each column in items of a list.

I am not married to that approach any alternative to do it is wellcome Many thanks

Advertisement

Answer

if I understood you question correctly then this example should work for you

JavaScript
User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement